-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Detect breaking changes to constraints in state:modifed #7476
Conversation
Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide. |
core/dbt/contracts/graph/nodes.py
Outdated
@@ -608,32 +654,99 @@ def same_contract(self, old) -> bool: | |||
contract_enforced_disabled: bool = False | |||
columns_removed: List[str] = [] | |||
column_type_changes: List[Tuple[str, str, str]] = [] | |||
enforced_column_constraint_removed: List[List[str]] = [] # column, constraint_type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason not to use a list of Tuple[str, str]
here and for enforced_model_constraint_removed
? Feels more consistent with the implementation so far (of columns_removed
) given the nested lists are of fixed length.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple nits/suggestions, nothing blocking. Great testing! ✨
* added test that fails * added new exception * add partial error checking - needs more specifics * move contract check under modelnode * try adding only enforced constraints * add checks for enforced constraints * changelog * add materialization logic * clean up tests, tweak materializations * PR feedback * more PR feedback * change to tuple
resolves #7065
Description
Detects breaking changes on state modified to enforced constraints. Accounts for constraints only considered enforced on table & incremental materializations.
Checklist
changie new
to create a changelog entry