Skip to content

Commit

Permalink
Integration test when excluding columns from union_relations
Browse files Browse the repository at this point in the history
  • Loading branch information
dbeatty10 committed May 13, 2022
1 parent 892d111 commit 854d334
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
6 changes: 6 additions & 0 deletions integration_tests/data/sql/data_union_exclude_expected.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
id,favorite_color,favorite_number
1,,pi
2,,e
3,,4
1,"green",7
2,"pink",13
5 changes: 5 additions & 0 deletions integration_tests/models/sql/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ models:
tests:
- dbt_utils.not_constant

- name: test_union_exclude
tests:
- dbt_utils.equality:
compare_model: ref('data_union_exclude_expected')

- name: test_get_relations_by_pattern
tests:
- dbt_utils.equality:
Expand Down
4 changes: 4 additions & 0 deletions integration_tests/models/sql/test_union_exclude.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
select
{{ dbt_utils.star(ref("test_union_exclude_base"), except=["_dbt_source_relation"]) }}

from {{ ref("test_union_exclude_base") }}
8 changes: 8 additions & 0 deletions integration_tests/models/sql/test_union_exclude_base.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

{{ dbt_utils.union_relations(
relations=[
ref('data_union_table_1'),
ref('data_union_table_2'),
],
exclude=['name']
) }}

0 comments on commit 854d334

Please sign in to comment.