-
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-2197] [Feature] Detect breaking changes to constraints in state:modified check #7065
Comments
Also a breaking change: You have a model with at least one constraint defined that the data platform can enforce. You switch the materialization of that model from |
or to |
Good point! We really shouldn't allow |
We are unclear on exactly what we would be checking has changed and how often. There's concern this would cause a slowdown in detecting changes if we have to check every single column for every model with a contract. |
We think this feature will be useful for us, We've tried using e.g., before version: 2
models:
- name: sometable
config:
contract:
enforced: true
columns:
- name: order_id
data_type: number
- name: order_name
data_type: varchar after -> then failed with version: 2
models:
- name: sometable
config:
contract:
enforced: true
columns:
- name: order_id
data_type: number
- name: order_name
data_type: varchar
- name: categories
data_type: varchar This is what you excepted? I read it and found this description.
My understanding is that it means allow adding columns in yaml, but current behavior does not. I'd like to know if this specification is as expected |
@sadahry Thanks for trying out the beta, and for the clear reproduction case! I agree that's not the intended behavior. It should be possible to add a new column without raising a |
@sadahry This will be fixed in #7333. Thank you so much for catching this! I'm very glad we were able to get the behavior working as intended before cutting the v1.5 release candidate. We'll be swinging back to this issue for v1.6, to add in the scope of raising an exception on breaking changes to |
Thank you for your quick fix! And looking forward to the enhancement for v1.6 👍 |
If a model with
contract: True
has its constraints modified in a way that represents a breaking change, dbt should raise an error as part of thestate:modified
check.What constitutes a breaking change?
table
toview
orephemeral
on a model that has at least one enforced constraint.Blocked by:
The text was updated successfully, but these errors were encountered: