Skip to content

Commit

Permalink
Test alias argument
Browse files Browse the repository at this point in the history
  • Loading branch information
judahrand committed Mar 22, 2022
1 parent 367e26b commit 18154e9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions integration_tests/data/sql/data_deduplicate.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
user_id,event,version
1,play,1
1,play,2
2,pause,1
19 changes: 17 additions & 2 deletions integration_tests/models/sql/test_deduplicate.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
with deduped as (
with

{{ dbt_utils.deduplicate(ref('data_deduplicate'), group_by='user_id', order_by='version desc') | indent }}
source as (
select *
from {{ ref('data_deduplicate') }}
where user_id = 1
),

deduped as (

{{
dbt_utils.deduplicate(
ref('data_deduplicate'),
group_by='user_id',
order_by='version desc',
alias="source"
) | indent
}}

)

Expand Down

0 comments on commit 18154e9

Please sign in to comment.