duckdb / dbt-duckdb

dbt (http://getdbt.com) adapter for DuckDB (http://duckdb.org)
Apache License 2.0
797 stars 69 forks source link

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

Closed amirbtb closed 4 months ago

amirbtb commented 10 months ago

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 10 months ago

Ah, interesting-- thank you so much Amir!