[Bug] copy_partitions with static partitions list produces empty statement #540
Labels
community
A PR, or an issue with a PR, from a community member
feature:incremental
Issues related to incremental materializations
pkg:dbt-bigquery
Issue affects dbt-bigquery
type:bug
Something isn't working as documented
Is this a new bug in dbt-bigquery?
Current Behavior
When an incremental load with
copy_partitions=True
, andpartitions=[... list of partitions ...]
is used, the macrobq_static_insert_overwrite_sql
does not produce any SQL statements, which leads the BigQuery client to trigger an error.On top of that, because this code:
is only executed when
copy_partitions=False
, the temp table is not deleted.Expected Behavior
A non-empty statement should be produced by the macro and sent to dbt. I figure that
drop table if exists {{tmp_relation}};
should just be taken out of any conditional blocks and just always be there.Steps To Reproduce
Relevant log output
14:48:05 Completed with 1 error and 0 warnings: 14:48:05 14:48:05 Database Error in model the_model (models/the_model.sql) Syntax error: Unexpected end of statement at [1:331] compiled Code at /Users/alex/the_project/target/run/the_project/models/the_model.sql
Environment
Additional Context
No response
The text was updated successfully, but these errors were encountered: