tests/generic/_generic_data_tests.yml or macros/_generic_data_tests.yml
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.
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: https://github.com/dbt-labs/dbt-core/issues/2578#issuecomment-1868473901
e.g., do something like this:
tests/generic/_generic_data_tests.yml
ormacros/_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