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

Model contract configs #59

Merged
merged 15 commits into from
Apr 4, 2023
Merged

Model contract configs #59

merged 15 commits into from
Apr 4, 2023

Conversation

dave-connors-3
Copy link
Contributor

@dave-connors-3 dave-connors-3 commented Mar 14, 2023

This PR adds the configs for the upcoming 1.5 dbt core concepts for model contracts

you can:

For projects:

  • define groups of models in _resource.yml files.

For models

  • define access - whether the model is public/private/protected
  • define contract - whether the model is subject to a model contract
  • define group - assign a model to a group

For columns:

  • define constraint - add a database constraint to the model
  • define constraint_check add a SQL check on the column

For metrics:

  • define groups in config -- sneaking in a config object, as metrics will be able to be grouped -- adding the other two metric configs while I was in there (can split this out if we'd prefer to sequence these more thoughtfully)

@dave-connors-3 dave-connors-3 marked this pull request as ready for review March 30, 2023 21:59
Copy link
Collaborator

@joellabes joellabes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looking hot! A few places where I think there's some changes since the first draft

Comment on lines 257 to 259
"+contract": {
"$ref": "#/$defs/boolean_or_jinja_string"
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

contract is an object now, containing a single bool enforced (dbt-labs/dbt-core#7184, dbt-labs/dbt-core#7222)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, this should be deleted. Per the tests in that second PR the contract object is nested in config and i added it to the model_config block down below

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh this is in the project yml file! will update!

schemas/dbt_yml_files.json Show resolved Hide resolved
schemas/dbt_yml_files.json Outdated Show resolved Hide resolved
schemas/dbt_yml_files.json Outdated Show resolved Hide resolved
schemas/dbt_yml_files.json Outdated Show resolved Hide resolved
schemas/dbt_yml_files.json Show resolved Hide resolved
tests/valid/schema.yml Outdated Show resolved Hide resolved
@dave-connors-3 dave-connors-3 merged commit bde7dcc into main Apr 4, 2023
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