Skip to content

Change behaviour of DBT constraints vs data tests when no model type specified on contract#748

Merged
jochenchrist merged 4 commits intodatacontract:mainfrom
skidave:dbtconstraints
May 22, 2025
Merged

Change behaviour of DBT constraints vs data tests when no model type specified on contract#748
jochenchrist merged 4 commits intodatacontract:mainfrom
skidave:dbtconstraints

Conversation

@skidave
Copy link
Contributor

@skidave skidave commented May 9, 2025

  • Tests pass
  • ruff format
  • README.md updated (if relevant)
  •  CHANGELOG.md entry added

The default DBT behaviour is to materialize models as views which do not support constraints, only data tests.

However, we don't want to assume a default DBT model type if none is specified in the contract and so the DBT exporter defaults to the more permissive data tests rather than constraints, and does not include the models[].config.materialized key in the DBT output.

This has no impact on data contracts that specify the model.type in the model object.

@jochenchrist
Copy link
Contributor

LGTM, thanks for the contribution!

@jochenchrist jochenchrist merged commit edf8bb8 into datacontract:main May 22, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants