From 44692396f7d3d5d8e52a52de8e1291291d07ef55 Mon Sep 17 00:00:00 2001 From: Patrick Ruoff <61174725+pruoff@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:33:40 +0200 Subject: [PATCH] FIX: Failing example for dbt_utils.deduplicate() in README.md (#856) * 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> --- README.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 0c341b8a..775b6bcb 100644 --- a/README.md +++ b/README.md @@ -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))