-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[CT-2755] [Bug] Allow on_schema_change = fail
for contracted incremental models
#7975
Comments
on_schema_change = fail
for contracted incremental modelson_schema_change = fail
for contracted incremental models
Thanks @graciegoheen! You're totally right that we should support dbt-core/core/dbt/contracts/graph/model_config.py Lines 495 to 504 in 5c7aa7f
Why only support these two, and not all four? This is an opinionated choice, but really:
The biggest reason in favor of supporting |
Does python-model support on_schema_change feature ? |
Is this a new bug in dbt-core?
Current Behavior
When I add a contract to an incremental model with
on_schema_change = fail
, I get the following error message:Expected Behavior
There's not a clear reason to prevent contracted incremental models from having
on_schema_change = fail
- which triggers an error message when the source and target schemas diverge. This config forces you to execute a full-refresh if you add a new column or remove and old column from your incremental model. Removing an old column would also break your "contract" - so there shouldn't be an issue with doubling up on errors here.I also don't see a strong reason to prevent
on_schema_change = ignore
, but at the minimum the "safest" incremental strategy (on_schema_change = fail
) should be allowed for contracted models.Steps To Reproduce
on_schema_change = fail
dbt build
Relevant log output
No response
Environment
Which database adapter are you using with dbt?
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: