You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ibis relies on duckdb.functional, which was exposed in duckdb/__init__.py.
It seems this was removed in 1.4.1 and thus makes Ibis unable to work with Duckdb
_UDF_INPUT_TYPE_MAPPING = {
> InputType.PYARROW: duckdb.functional.ARROW,
^^^^^^^^^^^^^^^^^
InputType.PYTHON: duckdb.functional.NATIVE,
}
E AttributeError: module 'duckdb' has no attribute 'functional'
.venv/lib64/python3.13/site-packages/ibis/backends/duckdb/__init__.py:52: AttributeError
To Reproduce
$ python -c 'import ibis.backends.duckdb'
Traceback (most recent call last):
File "<string>", line 1, in <module>
import ibis.backends.duckdb
File "/home/amol/src/orbital/.venv/lib64/python3.13/site-packages/ibis/backends/duckdb/__init__.py", line 52, in <module>
InputType.PYARROW: duckdb.functional.ARROW,
^^^^^^^^^^^^^^^^^
AttributeError: module 'duckdb' has no attribute 'functional'
OS:
Linux Ubuntu x86_64
DuckDB Package Version:
1.4.1
Python Version:
3.13.7
Full Name:
Alessandro Molina
Affiliation:
POSIT
What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.
I have tested with a stable release
Did you include all relevant data sets for reproducing the issue?
Yes
Did you include all code required to reproduce the issue?
Yes, I have
Did you include all relevant configuration to reproduce the issue?
The good news: duckdb.functional is still there, and so are its symbols, and if you import it explicitly (i.e. add import duckdb.functional at the top of your code) then things will work again:
❯ .venv/bin/python
Python 3.11.13 (main, Jul 8 2025, 20:42:09) [Clang 20.1.4 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import duckdb
>>> print(duckdb.__version__)
1.4.1
>>> import duckdb.functional
<stdin>:1: DeprecationWarning: `duckdb.functional` is deprecated and will be removed in a future version. Please use `duckdb.func` instead.
>>> print(duckdb.functional.ARROW)
PythonUDFType.ARROW
Adding import duckdb.functional is backwards compatible btw. Or it should be.
But this is indeed a miss on my end. The functional module is causing shadowing problems with stdlib's functional module, so I've removed almost all references to it and introduced duckdb.func, which is the same module but without the shadowing issues. (Hence the DeprecationWarning.) In the process I removed the import of .functional in init.py, which means it's no longer available as an imported symbol from duckdb. This is actually how it should be, but it wasn't my intention to introduce this change in a bugfix release.
Activity
evertlammerts commentedon Oct 7, 2025
The good news:
duckdb.functionalis still there, and so are its symbols, and if you import it explicitly (i.e. addimport duckdb.functionalat the top of your code) then things will work again:Adding
import duckdb.functionalis backwards compatible btw. Or it should be.But this is indeed a miss on my end. The
functionalmodule is causing shadowing problems with stdlib'sfunctionalmodule, so I've removed almost all references to it and introducedduckdb.func, which is the same module but without the shadowing issues. (Hence the DeprecationWarning.) In the process I removed the import of.functionalin init.py, which means it's no longer available as an imported symbol fromduckdb. This is actually how it should be, but it wasn't my intention to introduce this change in a bugfix release.amol- commentedon Oct 7, 2025
I'm going to open a PR in Ibis to import
duckdb.funcconditionally, which should address this issue and be future proof