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

[Core] How to add a description for custom generic tests #5631

Open
dbeatty10 opened this issue Jun 9, 2024 · 0 comments
Open

[Core] How to add a description for custom generic tests #5631

dbeatty10 opened this issue Jun 9, 2024 · 0 comments
Labels
content Improvements or additions to content dbt Core The changes proposed in this issue relate to dbt Core size: medium This change will take up to a week to address

Comments

@dbeatty10
Copy link
Contributor

dbeatty10 commented Jun 9, 2024

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:

  • generic
  • singular

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 tests/generic/_generic_data_tests.yml (EDIT: the 2nd one didn't work for me)

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: it doesn't strictly need to be named _generic_data_tests.yml; it could be something else like properties.yml.

Reviewers/Stakeholders/SMEs

.

Related GitHub issues

Additional information

No response

@dbeatty10 dbeatty10 added content Improvements or additions to content dbt Core The changes proposed in this issue relate to dbt Core labels Jun 9, 2024
@nataliefiann nataliefiann added the size: medium This change will take up to a week to address label Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content Improvements or additions to content dbt Core The changes proposed in this issue relate to dbt Core size: medium This change will take up to a week to address
Projects
None yet
Development

No branches or pull requests

2 participants