-
Notifications
You must be signed in to change notification settings - Fork 984
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
Add Model contracts section #3305
Add Model contracts section #3305
Conversation
✅ Deploy Preview for docs-getdbt-com ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site settings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good! @nghi-ly would love your eyes on this if you get a chance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you so much for adding this section, @damian3031 ! appreciate your contribution! left a couple small suggs
@@ -365,3 +365,7 @@ models: | |||
``` | |||
</File> | |||
|
|||
## Model contracts | |||
|
|||
The `dbt-trino` adapter supports [Model contracts](/docs/collaborate/govern/model-contracts). However, currently only `not_null` [constraint](/reference/resource-properties/constraints) is supported. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small sugg for a better clarity.
The `dbt-trino` adapter supports [Model contracts](/docs/collaborate/govern/model-contracts). However, currently only `not_null` [constraint](/reference/resource-properties/constraints) is supported. | |
The `dbt-trino` adapter supports [model contracts](/docs/collaborate/govern/model-contracts). Currently, only [constraints](/reference/resource-properties/constraints) with `type` as `not_null` are supported. |
## Model contracts | ||
|
||
The `dbt-trino` adapter supports [Model contracts](/docs/collaborate/govern/model-contracts). However, currently only `not_null` [constraint](/reference/resource-properties/constraints) is supported. | ||
Please ensure that underlying connector supports `not null`, before using this constraint in your model. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please ensure that underlying connector supports `not null`, before using this constraint in your model. | |
Before using a constraint in your model, make sure the underlying connector supports `not_null`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curious, what happens if it doesn't? what sort of issues will the user encounter if they do end up using it? it's good practice to inform people why they should do a thing as it helps with learning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While trying not_null
constraint on connector which doesn't support it, user will receive Trino error at dbt run stage, e.g.:
Hive tables do not support NOT NULL columns
Should I add detailed description in docs what would happen then? I think that it is not necessary in this case, as making sure that you use supported feature is self explanatory IMHO - you can't use feature, which is not supported 🙂
WDYT?
Head branch was pushed to by a user without write access
7ed3b70
to
8682d1b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated the sentence in question. lemme know what you think!
## Model contracts | ||
|
||
The `dbt-trino` adapter supports [model contracts](/docs/collaborate/govern/model-contracts). Currently, only [constraints](/reference/resource-properties/constraints) with `type` as `not_null` are supported. | ||
Before using `not_null` constraint in your model, make sure the underlying connector supports `not null`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're right, @damian3031 , that would be too much. how about this or something similar?
Before using `not_null` constraint in your model, make sure the underlying connector supports `not null`. | |
Before using `not_null` constraints in your model, make sure the underlying connector supports `not null` to avoid running into errors.``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adjusted, thanks!
8682d1b
to
1751879
Compare
Added Model contracts section in Trino configuration docs.