Currently, Python models returning a DuckDBPyRelation are materialized using pandas even if pyarrow is available. Because Pandas dataframes are not strongly typed, DuckDB uses inference for objects to determine the actual types when loading a dataframe. This causes empty VARCHAR cols to be incorrectly materialized with the default (INTEGER) type.
We switch the order to prefer pyarrow when available.
Currently, Python models returning a DuckDBPyRelation are materialized using
pandas
even ifpyarrow
is available. Because Pandas dataframes are not strongly typed, DuckDB uses inference for objects to determine the actual types when loading a dataframe. This causes empty VARCHAR cols to be incorrectly materialized with the default (INTEGER) type.We switch the order to prefer
pyarrow
when available.