Skip to content

Commit 23bc2b6

Browse files
committed
Add test for dedupe macro
1 parent 65d9f1a commit 23bc2b6

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
user_id,event,version
2+
1,play,1
3+
1,play,2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
user_id,event,version
2+
1,play,2

integration_tests/models/sql/schema.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ models:
8585
tests:
8686
- dbt_utils.equality:
8787
compare_model: ref('data_pivot_expected')
88-
88+
8989
- name: test_pivot_apostrophe
9090
tests:
9191
- dbt_utils.equality:
@@ -137,8 +137,13 @@ models:
137137
tests:
138138
- dbt_utils.equality:
139139
compare_model: ref('data_union_expected')
140-
140+
141141
- name: test_get_relations_by_pattern
142142
tests:
143143
- dbt_utils.equality:
144144
compare_model: ref('data_union_events_expected')
145+
146+
- name: test_dedupe
147+
tests:
148+
- dbt_utils.equality:
149+
compare_model: ref('data_dedupe_expected')
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
WITH deduped as (
2+
3+
{{ dbt_utils.dedupe(ref('data_dedupe'), group_by='user_id', order_by='version desc') | indent }}
4+
5+
)
6+
7+
select * from deduped

0 commit comments

Comments
 (0)