File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
airflow/include/sql/sparte
models/for_app/administration Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -192,3 +192,5 @@ models:
192192 values :
193193 - " true"
194194 - " false"
195+ data_tests :
196+ - has_all_lands
Original file line number Diff line number Diff line change 1+ {% test has_all_lands(model, exceptions= [], excluded_land_types= []) %}
2+
3+ select
4+ land .land_id ,
5+ land .land_type
6+ from {{ ref(' land' ) }} as land
7+ left join (
8+ select distinct land_id, land_type from {{ model }}
9+ ) as model
10+ on model .land_id = land .land_id
11+ and model .land_type = land .land_type
12+ where model .land_id is null
13+ {% if excluded_land_types %}
14+ and land .land_type not in (
15+ {% for lt in excluded_land_types %}
16+ ' {{ lt }}' {% if not loop .last %},{% endif %}
17+ {% endfor %}
18+ )
19+ {% endif %}
20+ {% if exceptions %}
21+ and (land .land_id , land .land_type ) not in (
22+ {% for e in exceptions %}
23+ (' {{ e.land_id }}' , ' {{ e.land_type }}' ){% if not loop .last %},{% endif %}
24+ {% endfor %}
25+ )
26+ {% endif %}
27+
28+ {% endtest %}
You can’t perform that action at this time.
0 commit comments