Skip to content

Commit

Permalink
FIX: Failing example for dbt_utils.deduplicate() in README.md (#856)
Browse files Browse the repository at this point in the history
* FIX: Failing example for dbt_utils.decuplicate() in README.md

* Cast to a `date`

---------

Co-authored-by: Doug Beatty <44704949+dbeatty10@users.noreply.github.com>
  • Loading branch information
pruoff and dbeatty10 authored Apr 23, 2024
1 parent 72d087b commit 4469239
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -904,14 +904,16 @@ with my_cte as (
select *
from {{ source('my_source', 'my_table') }}
where user_id = 1
),
deduplicated_cte as (
{{ dbt_utils.deduplicate(
relation='my_cte',
partition_by='user_id, cast(timestamp as date)',
order_by='timestamp desc',
)
}}
)

{{ dbt_utils.deduplicate(
relation='my_cte',
partition_by='user_id, cast(timestamp as day)',
order_by='timestamp desc',
)
}}
select * from deduplicated_cte
```

### haversine_distance ([source](macros/sql/haversine_distance.sql))

0 comments on commit 4469239

Please sign in to comment.