duckdb/dbt-duckdb

[Python models] ModuleNotFoundError: No module named 'pandas.core.arrays.arrow.dtype

amirbtb opened this issue · 1 comments

Hello,

First thank you a lot for this amazing adapter, coupled with the great work of the DuckDB community, it's just a delight.

I get an error with this simple python model :

def model(dbt, session):

    stg_simple_sql_model = dbt.ref("stg_simple_sql_model").fetchdf()

    final_df = (
        stg_simple_sql_model
        .drop([0,1,2])
        .reset_index()
    )

    return final_df

Error :

Completed with 1 error and 0 warnings:
 
Runtime Error in model simple_python_model (models/int/simple_python_model.py)
Python model failed:
Invalid Input Error: Required module 'pandas.core.arrays.arrow.dtype' failed to import, due to the following Python exception:
ModuleNotFoundError: No module named 'pandas.core.arrays.arrow.dtype'

It looks like it is due to a breaking change in the 2.1 version of pandas.

Running pip install pandas==2.0 solves the error.

I hope it helps anyone having the same error.

jwills commented

Ah, interesting-- thank you so much Amir!