-
Notifications
You must be signed in to change notification settings - Fork 999
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
[Core] How to add a description for custom generic tests #5631
Comments
@mirnawong1 I'm re-opening this because #6940 doesn't match the intent of this issue. #6193 describes (3) totally different ways to add a description to data tests:
#6940 provides good examples of (2) 💡 What's the difference between a definition and an instance?
So for (2), we'll want our docs to include an example of adding a description to the macro associated with the data test like this: macros:
- name: test_not_empty_string
description: Complementary test to default `not_null` test as it checks that there is not an empty string. It only accepts columns of type string. It is deprecated as this functionality has been included in the custom implementation of `not_null`
arguments:
- name: model
type: string
description: Model Name
- name: column_name
type: string
description: Column name that should not be an empty string 👉 Note that the |
oh i see, its about the jinja macro! ok got it, thank you for clarifying! |
hey @dbeatty10 ! ok i've created this pr #6944, which hopefully addresses this issue. mind having a look when you can? no rush of course |
Link to the page(s) on docs.getdbt.com requiring updates
https://docs.getdbt.com/best-practices/writing-custom-generic-tests
Tell us more about this update
There are two types of data tests, and users can create custom tests in both types:
When creating a custom generic test, many users want to add a description that shows up in the generated docs site.
One user described how to accomplish this goal: dbt-labs/dbt-core#2578 (comment)
e.g., do something like this:
macros/_generic_data_tests.yml
or(EDIT: the 2nd one didn't work for me)tests/generic/_generic_data_tests.yml
Note: it doesn't strictly need to be named
_generic_data_tests.yml
; it could be something else likeproperties.yml
.Reviewers/Stakeholders/SMEs
.
Related GitHub issues
Additional information
No response
The text was updated successfully, but these errors were encountered: