-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ADAP-834] [Regression] adapter.is_replacable()
always evaluates to False
with dbt-bigquery 1.6
#886
Comments
adapter.is_replacable()
always evaluates to False
with dbt-bigquery 1.6adapter.is_replacable()
always evaluates to False
with dbt-bigquery 1.6
However, dbt-bigquery/dbt/adapters/bigquery/impl.py Lines 625 to 628 in c210acf
Did some further testing, if we add in -- models/foo.sql
{{
config(
partition_by={
"field": "updated_at",
"data_type": "date",
"granularity": "day"
}
)
}}
select id, updated_at, updated_at_utc from sources.raw This didn't change the behaviour for me and was still evaluating to However, what did make the evaluation behave well was switching the partitioning field/datatype: -- models/foo.sql
{{
config(
materialized = 'table',
partition_by={
"field": "id",
"data_type": "int64",
"range": {
"start": 1,
"end": 100,
"interval": 1
}
}
)
}}
select id, updated_at, updated_at_utc from sources.raw By partitioning on an |
I think that this line in the latest commit is the bug: 7c21644#diff-96ff53dca401b9ca48009a58b6c77181552b72b2ad6867c37ae2f22f75a5bd38R609 The previous version had a
I believe the fix could be just a one-line change here, replacing: with: |
Thanks @github-christophe-oudar ! As an aside, I'm curious about the reasoning behind using a hard delete/drop relation implementation to handle this instead of the safer, typical dbt approach of using a _tmp table to accomplish this? In our case, this hard delete broke the contract with our external data consumers, and the table was missing for a significant period of time since the model rebuild consumes a lot of compute resources and takes a while to complete. |
Just an FYI, this issue appears to be a duplicate |
I added a test this time so that it's protected from unexpected changes Regarding the hard delete approach... I can't tell why, it was already there when I started contributing. |
Afaict, the "main" "columnar store" adapters
With the exception of Redshift - since it inherits from Postgres and that does create the The exception to the above is the Given all of the above, I think it's probably worth opening a separate issue to ask for that change and see what the other @dbt-labs/core-adapters members think of the proposal. |
adapter.is_replacable()
always evaluates to False
with dbt-bigquery 1.6adapter.is_replacable()
always evaluates to False
with dbt-bigquery 1.6
Is this a new bug in dbt-bigquery?
Current Behavior
There's a pretty strange behaviour with 1.6 where the
adapter.is_replacable()
method seems to always evaluate toFalse
in 1.6, even if the partition configuration of a model has not been changed. This could cause unintended side-effects - like dropping the previous table even if not required.dbt-bigquery/dbt/include/bigquery/macros/materializations/table.sql
Lines 27 to 30 in eb58c7d
Expected Behavior
We should keep to the behaviour prior to 1.6.
Steps To Reproduce
foo
a few times:Attached a full debug log for one of the above invocations - but nothing of interest really.
If you downgrade to dbt-bigquery 1.5.latest (
dbt==1.5.4, dbt-bigquery==1.5.5
) - you will not see such log lines.Relevant log output
Environment
Additional Context
To confirm
is_replacable
is evaluating incorrectly with 1.6, I used a custom materialization next:Then modify
foo.sql
to make use of it:The text was updated successfully, but these errors were encountered: