From e59f2890b949df903823b313a138209db879c810 Mon Sep 17 00:00:00 2001 From: Carl Cervone <42869436+ccerv1@users.noreply.github.com> Date: Fri, 6 Dec 2024 18:40:45 -0500 Subject: [PATCH] fix(dbt): gitcoin round namings (#2600) * fix: remove rounds dagster asset * fix: round naming --- .../funding/int_gitcoin_funding_events.sql | 27 ++++++++++++++++--- .../gitcoin_funding_events_by_project_v0.sql | 17 +----------- warehouse/oso_dagster/assets/gitcoin.py | 4 --- 3 files changed, 25 insertions(+), 23 deletions(-) diff --git a/warehouse/dbt/models/intermediate/funding/int_gitcoin_funding_events.sql b/warehouse/dbt/models/intermediate/funding/int_gitcoin_funding_events.sql index 62da2fdf..21c2c6ae 100644 --- a/warehouse/dbt/models/intermediate/funding/int_gitcoin_funding_events.sql +++ b/warehouse/dbt/models/intermediate/funding/int_gitcoin_funding_events.sql @@ -4,6 +4,27 @@ with unioned_funding_events as ( select * from {{ ref('stg_gitcoin__matching') }} ), +cleaned_funding_events as ( + select + * except (gitcoin_round_id), + case + when + gitcoin_data_source = 'Alpha' + and round_name = 'Ethereum Infrastructure' + then 'alpha-eth-infra' + when + gitcoin_data_source = 'Alpha' + and round_name = 'Open Source Software' + then 'alpha-oss' + when + gitcoin_data_source = 'Alpha' + and round_name = 'Climate Solutions' + then 'alpha-climate' + else gitcoin_round_id + end as gitcoin_round_id + from unioned_funding_events +), + funding_events_with_round_types as ( select *, @@ -32,7 +53,7 @@ funding_events_with_round_types as ( ) then 'PartnerRound' else 'MainRound' end as round_type - from unioned_funding_events + from cleaned_funding_events ), labeled_funding_events as ( @@ -70,8 +91,8 @@ labeled_funding_events as ( when round_type = 'PartnerRound' then concat( round_type, ' - ', - cast(chain_id as string), ' - ', - gitcoin_round_id + gitcoin_round_id, ' - ', + cast(chain_id as string) ) end as oso_generated_round_label from funding_events_with_round_types diff --git a/warehouse/dbt/models/marts/gitcoin/gitcoin_funding_events_by_project_v0.sql b/warehouse/dbt/models/marts/gitcoin/gitcoin_funding_events_by_project_v0.sql index c33ea190..6e710529 100644 --- a/warehouse/dbt/models/marts/gitcoin/gitcoin_funding_events_by_project_v0.sql +++ b/warehouse/dbt/models/marts/gitcoin/gitcoin_funding_events_by_project_v0.sql @@ -13,20 +13,5 @@ select oso_project_name, oso_display_name, donor_address, - sum(amount_in_usd) as amount_in_usd + amount_in_usd from {{ ref('int_gitcoin_funding_events') }} -group by - event_time, - gitcoin_data_source, - gitcoin_round_id, - round_number, - round_type, - main_round_label, - round_name, - oso_generated_round_label, - gitcoin_project_id, - project_application_title, - oso_project_id, - oso_project_name, - oso_display_name, - donor_address diff --git a/warehouse/oso_dagster/assets/gitcoin.py b/warehouse/oso_dagster/assets/gitcoin.py index 8b49f529..8eff2674 100644 --- a/warehouse/oso_dagster/assets/gitcoin.py +++ b/warehouse/oso_dagster/assets/gitcoin.py @@ -45,9 +45,5 @@ "table": "all_matching", "write_disposition": "replace", }, - { - "table": "public.Round", - "write_disposition": "replace", - }, ], )