Skip to content

Instantly share code, notes, and snippets.

@zoltanctoth
Created September 22, 2022 09:00
Show Gist options
  • Save zoltanctoth/472485f342f3ce020e22ec5a987d5824 to your computer and use it in GitHub Desktop.
Save zoltanctoth/472485f342f3ce020e22ec5a987d5824 to your computer and use it in GitHub Desktop.
Creating a simple custom test (no extra parameters) in dbt
{% test valid_age(model, column_name) %}
SELECT COUNT(*) FROM {{ model }}
WHERE NOT {{ column_name}} BETWEEN 0 and 125
{% endtest %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment