Skip to content

Release 1.4.1 broke Ibis #108

Closed
Closed

Description

@amol-

What happens?

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?

  • Yes, I have

Activity

  1. evertlammerts commented on Oct 7, 2025

    @evertlammerts
    Member

    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.

  2. amol- commented on Oct 7, 2025

    @amol-
    Author

    I'm going to open a PR in Ibis to import duckdb.func conditionally, which should address this issue and be future proof

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    wontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions