s&p update models
This commit is contained in:
parent
384665c487
commit
c95f551acf
9 changed files with 158 additions and 39 deletions
10
macros/tests/at_least_one_null.sql
Normal file
10
macros/tests/at_least_one_null.sql
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{% test at_least_one_null(model, columns) %}
|
||||
|
||||
select *
|
||||
from {{ model }}
|
||||
where
|
||||
{% for column in columns %}
|
||||
{{ column }} is not null {% if not loop.last %} and {% endif %}
|
||||
{% endfor %}
|
||||
-- If all columns are not null, the row violates the test
|
||||
{% endtest %}
|
||||
3
macros/tests/is_first_day_of_month.sql
Normal file
3
macros/tests/is_first_day_of_month.sql
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{% test is_first_day_of_month(model, column_name) %}
|
||||
select * from {{ model }} where extract(day from {{ column_name }}) != 1
|
||||
{% endtest %}
|
||||
9
macros/tests/is_last_day_of_month.sql
Normal file
9
macros/tests/is_last_day_of_month.sql
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{% test is_last_day_of_month(model, column_name) %}
|
||||
select *
|
||||
from {{ model }}
|
||||
where
|
||||
{{ column_name }}
|
||||
!= date_trunc('MONTH', {{ column_name }})
|
||||
+ interval '1 MONTH'
|
||||
- interval '1 DAY'
|
||||
{% endtest %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue