From 3997663850b32d89d108335ff4b6cefada472979 Mon Sep 17 00:00:00 2001 From: Patrick Ruoff <61174725+pruoff@users.noreply.github.com> Date: Thu, 23 Nov 2023 10:25:44 +0100 Subject: [PATCH 1/2] FIX: Failing example for dbt_utils.decuplicate() in README.md --- README.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 827626ba..7022122f 100644 --- a/README.md +++ b/README.md @@ -888,14 +888,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 day)', + 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)) From 9665a988392ec65738a1ae86c40ce031df572ce7 Mon Sep 17 00:00:00 2001 From: Doug Beatty <44704949+dbeatty10@users.noreply.github.com> Date: Tue, 23 Apr 2024 14:31:23 -0600 Subject: [PATCH 2/2] Cast to a `date` --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7022122f..e61940d4 100644 --- a/README.md +++ b/README.md @@ -892,7 +892,7 @@ with my_cte as ( deduplicated_cte as ( {{ dbt_utils.deduplicate( relation='my_cte', - partition_by='user_id, cast(timestamp as day)', + partition_by='user_id, cast(timestamp as date)', order_by='timestamp desc', ) }}