Critical severitydata_quality
Power BI Refresh Error:
ContractBreakingChangeError
What does this error mean?
dbt rejected a model change because it violates an enforced data contract — a column was removed, its data type was changed, or a constraint was dropped.
Common causes
- 1A developer removed a column from a model that has contract: enforced in its YAML definition
- 2The data type of a contracted column was changed (e.g., INT to VARCHAR) without updating the contract
- 3A NOT NULL or PRIMARY KEY constraint was removed from a contracted column
- 4The model's schema.yml was not updated to reflect legitimate schema changes before running dbt
How to fix it
- 1Step 1: Read the error message to identify which column or constraint was removed or changed.
- 2Step 2: If the change is intentional: update the contract definition in the model's schema.yml to reflect the new schema, treating it as a versioned breaking change.
- 3Step 3: If the change was accidental: restore the column or constraint in the model SQL.
- 4Step 4: Consider using dbt model versioning (v:) to introduce a new version of the model and deprecate the old one, giving consumers time to migrate.
- 5Step 5: Run dbt parse and dbt compile to validate the updated contract before re-running.