Adding new column test: latest_date_is_yesterday
This commit is contained in:
parent
1e89966153
commit
0f73b70942
2 changed files with 16 additions and 1 deletions
13
macros/tests/latest_date_is_yesterday.sql
Normal file
13
macros/tests/latest_date_is_yesterday.sql
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{% test latest_date_is_yesterday(model, column_name) %}
|
||||
|
||||
with
|
||||
model_max_date as (
|
||||
select max({{ column_name }}) as max_date
|
||||
from {{ model }}
|
||||
)
|
||||
|
||||
select *
|
||||
from model_max_date
|
||||
where max_date <> current_date - 1
|
||||
|
||||
{% endtest %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue