calogica / dbt-expectations

Port(ish) of Great Expectations to dbt test macros
https://calogica.github.io/dbt-expectations/
Apache License 2.0
989 stars 120 forks source link

Run for every model instead of adding in each model #266

Closed KarthikRajashekaran closed 10 months ago

KarthikRajashekaran commented 1 year ago

I would like to test every model for example, I want to check every model has no empty rows expect_table_column_count_to_be_between

I do not want to be added to each model yml file in DBT test , below is what test every model count


{% test not_empty(model) %}

select 1
from (select COUNT(*) as cnt from {{ model }}) as t
where cnt = 0;

{% endtest %}

Is there a better approach?

owenprough-sift commented 1 year ago

Duplicate of #209?