-
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
adds description example of core logic for generic test #6944
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Hiya @mirnawong1
Thanks for creating this PR! I've approved this for you. No recommendations or suggestions from me.
Kind Regards
Natalie
Co-authored-by: Doug Beatty <[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.
Looks good to me!
Note
If the name of the test block is not_empty_string
, then the name of the macro to document has test_
added to the front: test_not_empty_string
.
So documenting a macro named test_something
would be applied to the test definition in tests/generic
named something
.
Example
For example tests/generic/not_empty_string.sql
:
{% test not_empty_string(model, column_name) %}
select {{ column_name }}
from {{ model }}
where {{ column_name }} = ''
{% endtest %}
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`
this pr tries to clarify how to add descriptions to the Jinja macro that provides the core logic of a generic data test.
updates done in the following pages:
Resolves #5631
🚀 Deployment available! Here are the direct links to the updated files: