From de3834c577a45a046a8ae1759822c3c8da1a17ee Mon Sep 17 00:00:00 2001 From: Javier R Date: Tue, 24 Sep 2024 22:08:40 +0200 Subject: [PATCH] fix: filter out non `USD` transactions --- .../open-collective/stg_open_collective__events.sql | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/warehouse/dbt/models/staging/open-collective/stg_open_collective__events.sql b/warehouse/dbt/models/staging/open-collective/stg_open_collective__events.sql index 89104114..557b44ba 100644 --- a/warehouse/dbt/models/staging/open-collective/stg_open_collective__events.sql +++ b/warehouse/dbt/models/staging/open-collective/stg_open_collective__events.sql @@ -1,9 +1,13 @@ with open_collective_expenses as ( - select * from {{ open_collective_events("stg_open_collective__expenses") }} + select * + from {{ open_collective_events("stg_open_collective__expenses") }} + where JSON_VALUE(amount, "$.currency") = "USD" ), open_collective_deposits as ( - select * from {{ open_collective_events("stg_open_collective__deposits") }} + select * + from {{ open_collective_events("stg_open_collective__deposits") }} + where JSON_VALUE(amount, "$.currency") = "USD" ) select * from open_collective_expenses