Skip to content

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

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

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.

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.

1 participant