Skip to content

Commit

Permalink
pyarrow should not be required to run dbt-duckdb python models
Browse files Browse the repository at this point in the history
  • Loading branch information
jwills committed May 4, 2023
1 parent 4ddd363 commit 17cb912
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dbt/include/duckdb/macros/adapters.sql
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,11 @@
def materialize(df, con):
try:
import pyarrow
pyarrow_available = True
except ImportError:
pass
pyarrow_available = False
finally:
if isinstance(df, pyarrow.Table):
if pyarrow_available and isinstance(df, pyarrow.Table):
# https://github.com/duckdb/duckdb/issues/6584
import pyarrow.dataset
con.execute('create table {{ relation.include(database=adapter.use_database()) }} as select * from df')
Expand Down

0 comments on commit 17cb912

Please sign in to comment.