-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add trino__equality_fct_multiple_sources_joined test
- Loading branch information
1 parent
bf1f784
commit b7ab0e4
Showing
7 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...ation_tests/dbt_project_evaluator/models/marts/dag/trino__fct_multiple_sources_joined.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
-- this model finds cases where a model references more than one source | ||
with direct_source_relationships as ( | ||
select distinct | ||
child, | ||
parent | ||
from {{ ref('int_all_dag_relationships') }} | ||
where distance = 1 | ||
and parent_resource_type = 'source' | ||
and not parent_is_excluded | ||
and not child_is_excluded | ||
-- we order the CTE so that listagg returns values correctly sorted for some warehouses | ||
order by 1, 2 | ||
), | ||
|
||
multiple_sources_joined as ( | ||
select | ||
child, | ||
{{ dbt.listagg( | ||
measure='parent', | ||
delimiter_text="', '", | ||
order_by_clause='order by parent') | ||
}} as source_parents | ||
from direct_source_relationships | ||
group by 1 | ||
having count(*) > 1 | ||
) | ||
|
||
select * from multiple_sources_joined | ||
|
||
{{ trino__filter_exceptions(model.name) }} |
9 changes: 9 additions & 0 deletions
9
integration_tests/dbt_project_evaluator/seeds/dag/dag_seeds.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
...gration_tests/dbt_project_evaluator/seeds/dag/trino__test_fct_multiple_sources_joined.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
child,source_parents | ||
stg_model_2,"source_1.table_1, source_1.table_2" |
2 changes: 1 addition & 1 deletion
2
...gration_tests/dbt_project_evaluator/seeds/docs/trino__test_fct_documentation_coverage.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
total_models,documented_models,documentation_coverage_pct,staging_documentation_coverage_pct,intermediate_documentation_coverage_pct,marts_documentation_coverage_pct,other_documentation_coverage_pct | ||
18,3,16.7,20.00,0.00,0.00,66.7 | ||
19,3,15.8,20.00,0.00,0.00,66.7 |
2 changes: 1 addition & 1 deletion
2
integration_tests/dbt_project_evaluator/seeds/tests/trino__test_fct_test_coverage.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
total_models,total_tests,tested_models,test_coverage_pct,staging_test_coverage_pct,intermediate_test_coverage_pct,marts_test_coverage_pct,other_test_coverage_pct,test_to_model_ratio | ||
18,11,5,27.8,80.00,50.00,0.00,0.00,0.6 | ||
19,11,5,26.3,80.00,50.00,0.00,0.00,0.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters