-
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
[Bug] Renaming or removing a contracted model should raise a BreakingChange warning/error #10116
Comments
@MichelleArk link an example of the current implementation for similar errors in the contracted model. |
The existing call sites for dbt-core/core/dbt/contracts/graph/nodes.py Lines 573 to 755 in 03b621f
However, in the case of a model that's been renamed/removed, we can't rely on Acceptance criteria
|
Updating the docs here would make sense! https://docs.getdbt.com/docs/collaborate/govern/model-contracts#how-are-breaking-changes-handled |
Opened a new issue in dbt-labs/docs.getdbt.com: dbt-labs/docs.getdbt.com#5574 |
Is this a new bug in dbt-core?
Current Behavior
When a contracted model changes or disables its contract, dbt raises a warning (
UnversionedBreakingChange
) or error (ContractBreakingChangeError
) within thesame_contract
check triggered bystate:modified
selection/comparison.However, the same warning/error does not occur if the user simply deletes or renames a contracted model. I believe it should — until/unless unless that contracted model has passed a defined
deprecation_date
, at which point deletion is allowed.Expected Behavior
If a contracted model is present in the comparison manifest, and missing in the current manifest, raise a warning (if unversioned) or error (if versioned) accordingly. Add a new type of "breaking change" for "renamed or removed."
Naïve implementation for illustrative purposes only:
Steps To Reproduce
contract: {enforced: true}
state/
dbt list -s state:modified --state
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: