data-dwh-dbt-project/macros/tests/not_negative.sql
2024-06-20 14:43:51 +02:00

6 lines
187 B
SQL

{% test not_negative(model, column_name) %}
with validation as (select {{ column_name }} as value from {{ model }})
select *
from validation
where value < 0
{% endtest %}