Adding new column test: latest_date_is_yesterday

This commit is contained in:
uri 2024-09-06 09:13:27 +02:00
parent 1e89966153
commit 0f73b70942
2 changed files with 16 additions and 1 deletions

View 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 %}

View file

@ -362,6 +362,7 @@ models:
It comes from int_dates_mtd logic.
tests:
- not_null
- latest_date_is_yesterday
- name: dimension
data_type: string
@ -461,7 +462,8 @@ models:
description: The last day of the month or yesterday for historic metrics.
tests:
- not_null
- latest_date_is_yesterday
- name: id_deal
data_type: character varying
description: Id of the deal associated to the host.