Skip to content
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-2969] [ModelGov3] Turn "Breaking Change to Contract" into warning, unless model is versioned #8384

Closed
1 task done
Tracked by #7979
jtcohen6 opened this issue Aug 14, 2023 · 0 comments · Fixed by #8451
Closed
1 task done
Tracked by #7979
Assignees

Comments

@jtcohen6
Copy link
Contributor

Housekeeping

  • I am a maintainer of dbt-core

Short description

  • A breaking change to a model with an enforced contract should raise a warning (but CI will still succeed)
  • Unless that model is versioned, in which case dbt understands that its API is locked in
  • If it is versioned, you can add a new version (or just bump the existing model's version) to facilitate the breaking change
  • If it's just a warning, you can still optionally promote that warning to an error (without messing with model versions) via the --warn-error / --warn-error-options config

Acceptance criteria

As the create of a model with an enforced contract, if I remove/type/rename column(s) relative to a previous invocation, I should see a warning if I perform a state comparison (state:modified).

That warning/event should have a unique name, and I should be able to promote that warning to an error via --warn-error or --warn-error-options.

As the creator of a versioned model with an enforced contract, if I remove/retype/rename column(s) relative to a previous invocation, I should still see an error if I perform a state comparison (state:modified).

Impact to Adapters

zero impact

Context

Context & conversation:

# Did we find any changes that we consider breaking? If so, that's an error
if (
contract_enforced_disabled
or columns_removed
or column_type_changes
or enforced_model_constraint_removed
or enforced_column_constraint_removed
or materialization_changed
):
raise (
ContractBreakingChangeError(
contract_enforced_disabled=contract_enforced_disabled,
columns_removed=columns_removed,
column_type_changes=column_type_changes,
enforced_column_constraint_removed=enforced_column_constraint_removed,
enforced_model_constraint_removed=enforced_model_constraint_removed,
materialization_changed=materialization_changed,
node=self,
)
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants