-
Notifications
You must be signed in to change notification settings - Fork 74
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 1.5 features - fct_public_models_without_contracts #339
Conversation
we'll have to wait for dbx to release 1.5, but otherwise ready for review @graciegoheen @b-per ! |
Did you check the docs that get generated? I think that you will need to update the |
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.
A couple of changes required for the docs but except that it's all good for me
Co-authored-by: Benoit Perigaud <[email protected]>
…t-project-evaluator into public-models-have-contracts
docs/rules/governance.md
Outdated
description: very important OKR reporting model | ||
access: public | ||
config: | ||
materialized: table |
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.
Are public models required to be materialized as a table? If so, let's add a note about that. If not, let's remove this from the example because it's a difference between the public model without a contract example
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.
I don't think they are! removed
docs/rules/governance.md
Outdated
|
||
## Undocumented public models | ||
|
||
`fct_undocumented_public_models` ([source](https://github.com/dbt-labs/dbt-project-evaluator/blob/main/models/marts/governance/fct_undocumented_public_models.sql)) shows each model with `access` configured as public that is not fully documented. This check is similar to `fct_undocumented_models` ([source](https://github.com/dbt-labs/dbt-project-evaluator/blob/main/models/marts/documentation/fct_undocumented_models.sql)), but is a stricter check that will highlight any public model that does not have a model-level description as well descriptions on each of its columns. |
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 the reason to have both this model and fct_undocumented_models
? Seems a bit redundant to have both, though this captures documenting at the column level so maybe it's ok for the bit of overlap?
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.
I think it's to have a stricter requirement that is called out separately (better signal to noise ratio) and also have details at the column level as you note. It's more important for these models to be documented than it is for a random staging model!
docs/rules/governance.md
Outdated
|
||
**Example** | ||
|
||
`report_1` is defined as a public model, but does not descriptions on the model and each column |
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.
`report_1` is defined as a public model, but does not descriptions on the model and each column | |
`report_1` is defined as a public model, but does not have descriptions on the model and each column |
docs/rules/governance.md
Outdated
|
||
**How to Remediate** | ||
|
||
Edit the yml to include a model level description, as well as a column entry with a description for all columns output by the model. While not strictly required for public models, these should likely also have contracts added as well. (See above rule) |
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.
Can you link to the "above" rule (and name it, in case at some point it's no longer "above")
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.
done!
docs/rules/governance.md
Outdated
access: public | ||
config: | ||
materialized: table | ||
contract: |
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.
This example shows the fix as also adding a contract. I wonder if we could have 2 different examples for these 2 rules so it's clear what needs to be added to remediate this specific issue
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.
yeah i note in the description that it's not required, but encouraged -- I can remove if we think it's too confusing
|
||
## Exposures dependent on private models | ||
|
||
`fct_exposures_dependent_on_private_models` ([source](https://github.com/dbt-labs/dbt-project-evaluator/blob/main/models/marts/governance/fct_exposures_dependent_on_private_models.sql)) shows each relationship between a resource and an exposure where the parent resource is not a model with `access` configured as public. |
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.
Do we still need fct_exposure_parents_materializations
or can these be combined?
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.
it's a good question! this one is a bit stricter -- do we think folks not using governance features will get value out of this rule in the absence of the other?
docs/rules/governance.md
Outdated
|
||
**How to Remediate** | ||
|
||
Edit the yml to include fully expose the models that your exposures depend on. This should include `access`, a full model contract, and descriptions at all levels of the 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.
Again, what is the actual rule here? If it's just checking for access... should we also show adding contracts, descriptions, etc.
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.
yeah, I updated this description to be more clear. I can remove the extra details if we think they are not helpful
@@ -31,6 +33,8 @@ all_relationships ( | |||
child_resource_type, | |||
child_model_type, | |||
child_materialized, | |||
child_access, | |||
child_is_public, |
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.
Why the need for both access
and is_public
- isn't is_public
just if access == 'public'
?
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.
I think just to allow for future rules that use access
! can remove for now if we don't think it's valuable
Co-authored-by: Grace Goheen <[email protected]>
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.
🥐
This is a:
Link to Issue
This PR is in partial fulfillment of #332
Description & motivation
this PR adds:
for models and adds:
fct_public_models_without_contracts
- outputs each model withaccess: public
andconfig.contract.enforced: false
fct_exposures_dependent_on_private_models
- exposure parent that is not a public modelfct_undocumented_public_models
- outputs each undocumented public modelIntegration Test Screenshot
Checklist