From fe74b324351728cb9f0142bc71edd85877a5c5cd Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Thu, 19 Sep 2024 20:46:02 +0000 Subject: [PATCH 1/9] refactor(benefits): rename 'selected enrollment flow' event --- warehouse/models/mart/benefits/fct_benefits_events.sql | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/warehouse/models/mart/benefits/fct_benefits_events.sql b/warehouse/models/mart/benefits/fct_benefits_events.sql index 88e895bb10..98deb5c9cb 100644 --- a/warehouse/models/mart/benefits/fct_benefits_events.sql +++ b/warehouse/models/mart/benefits/fct_benefits_events.sql @@ -9,7 +9,11 @@ WITH fct_benefits_events AS ( client_event_time, event_id, session_id, - event_type, + case + when event_type = "selected eligibility verifier" + then "selected enrollment flow" + else event_type + end as event_type, version_name, os_name, os_version, From 0d37b2a85091109ed75a193869ec6a354315a9a2 Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Thu, 19 Sep 2024 20:49:59 +0000 Subject: [PATCH 2/9] refactor(benefits): coalesce enrollment_flows props deprecate old cols in mart definition --- .../models/mart/benefits/_mart_benefits.yml | 16 ++++++++++-- .../mart/benefits/fct_benefits_events.sql | 26 ++++++++++++++++--- 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/warehouse/models/mart/benefits/_mart_benefits.yml b/warehouse/models/mart/benefits/_mart_benefits.yml index b5e9d0b298..b6e37adfa3 100644 --- a/warehouse/models/mart/benefits/_mart_benefits.yml +++ b/warehouse/models/mart/benefits/_mart_benefits.yml @@ -84,7 +84,13 @@ models: - name: event_properties_transit_agency description: The `transit_agency` value from the `event_properties` column - name: event_properties_eligibility_types - description: A semi-colon delimited list of `eligibility_types` values from the `event_properties` column + description: A semi-colon delimited list of `enrollment_flows` values from the `event_properties` column + deprecated: + enabled: true + reason: "This column is deprecated, use `event_properties_enrollment_flows` instead" + date: "2024-09-19" + - name: event_properties_enrollment_flows + description: A semi-colon delimited list of `enrollment_flows` values from the `event_properties` column - name: user_properties_eligibility_verifier description: The `eligibility_verifier` value from the `user_properties` column - name: user_properties_initial_referrer @@ -100,4 +106,10 @@ models: - name: user_properties_user_agent description: The `user_agent` value from the `user_properties` column - name: user_properties_eligibility_types - description: A semi-colon delimited list of `eligibility_types` values from the `user_properties` column + description: A semi-colon delimited list of `enrollment_flows` values from the `user_properties` column + deprecated: + enabled: true + reason: "This column is deprecated, use `user_properties_enrollment_flows` instead" + date: "2024-09-19" + - name: user_properties_enrollment_flows + description: A semi-colon delimited list of `enrollment_flows` values from the `user_properties` column diff --git a/warehouse/models/mart/benefits/fct_benefits_events.sql b/warehouse/models/mart/benefits/fct_benefits_events.sql index 98deb5c9cb..6f3059ce43 100644 --- a/warehouse/models/mart/benefits/fct_benefits_events.sql +++ b/warehouse/models/mart/benefits/fct_benefits_events.sql @@ -48,7 +48,15 @@ WITH fct_benefits_events AS ( {{ json_extract_column('event_properties', 'payment_group') }}, {{ json_extract_column('event_properties', 'status') }}, {{ json_extract_column('event_properties', 'transit_agency') }}, - {{ json_extract_flattened_column('event_properties', 'eligibility_types') }}, + + -- Historical data existed in `eligibility_types` but new data is in `enrollment_flows` + -- https://github.com/cal-itp/benefits/pull/2379 + COALESCE( + {{ json_extract_flattened_column('event_properties', 'enrollment_flows', no_alias = true) }}, + {{ json_extract_flattened_column('event_properties', 'eligibility_types', no_alias = true) }} + ) AS event_properties_enrollment_flows, + -- include the old field as well, deprecated in the mart definition + event_properties_enrollment_flows AS event_properties_eligibility_types, -- User Properties (https://app.amplitude.com/data/compiler/Benefits/properties/main/latest/user) {{ json_extract_column('user_properties', 'eligibility_verifier') }}, @@ -65,7 +73,15 @@ WITH fct_benefits_events AS ( {{ json_extract_column('user_properties', 'referrer') }}, {{ json_extract_column('user_properties', 'referring_domain') }}, {{ json_extract_column('user_properties', 'user_agent') }}, - {{ json_extract_flattened_column('user_properties', 'eligibility_types') }} + + -- Historical data existed in `eligibility_types` but new data is in `enrollment_flows` + -- https://github.com/cal-itp/benefits/pull/2379 + COALESCE( + {{ json_extract_flattened_column('user_properties', 'enrollment_flows', no_alias = true) }}, + {{ json_extract_flattened_column('user_properties', 'eligibility_types', no_alias = true) }} + ) AS user_properties_enrollment_flows, + -- include the old field as well, deprecated in the mart definition + user_properties_enrollment_flows as user_properties_eligibility_types FROM {{ ref('stg_amplitude__benefits_events') }} ), @@ -115,7 +131,8 @@ fct_old_enrollments AS ( "5170d37b-43d5-4049-899c-b4d850e14990" as event_properties_payment_group, "success" as event_properties_status, "Monterey-Salinas Transit" as event_properties_transit_agency, - "senior" as event_properties_eligibility_types, + "senior" as event_properties_enrollment_flows, + event_properties_enrollment_flows as event_properties_eligibility_types, CASE WHEN client_event_time < '2022-08-12T07:00:00Z' THEN "DMV" @@ -128,7 +145,8 @@ fct_old_enrollments AS ( user_properties_user_agent, user_properties_referrer, user_properties_referring_domain, - "senior" as user_properties_eligibility_types + "senior" as user_properties_enrollment_flows, + user_properties_enrollment_flows as user_properties_eligibility_types FROM fct_benefits_events WHERE client_event_time >= '2021-12-08T08:00:00Z' and client_event_time < '2022-08-29T07:00:00Z' From bb35808d3c98c5d2593487d819ca2f923748136e Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Thu, 10 Oct 2024 16:31:37 +0000 Subject: [PATCH 3/9] chore(benefits): update historical eligibility verifier names --- warehouse/models/mart/benefits/fct_benefits_events.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/warehouse/models/mart/benefits/fct_benefits_events.sql b/warehouse/models/mart/benefits/fct_benefits_events.sql index 6f3059ce43..fd5f8149af 100644 --- a/warehouse/models/mart/benefits/fct_benefits_events.sql +++ b/warehouse/models/mart/benefits/fct_benefits_events.sql @@ -117,9 +117,9 @@ fct_old_enrollments AS ( event_properties_card_tokenize_url, CASE WHEN client_event_time < '2022-08-12T07:00:00Z' - THEN "DMV" + THEN "ca-dmv" WHEN client_event_time >= '2022-08-12T07:00:00Z' - THEN "(MST) CDT claims via Login.gov" + THEN "cdt-logingov" END as event_properties_eligibility_verifier, event_properties_error_name, event_properties_error_status, @@ -135,9 +135,9 @@ fct_old_enrollments AS ( event_properties_enrollment_flows as event_properties_eligibility_types, CASE WHEN client_event_time < '2022-08-12T07:00:00Z' - THEN "DMV" + THEN "ca-dmv" WHEN client_event_time >= '2022-08-12T07:00:00Z' - THEN "(MST) CDT claims via Login.gov" + THEN "cdt-logingov" END as user_properties_eligibility_verifier, user_properties_initial_referrer, user_properties_initial_referring_domain, From 395d193efc523b855302927ddf7e9266ac6dea7a Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Thu, 10 Oct 2024 16:46:08 +0000 Subject: [PATCH 4/9] refactor(benefits): coalesce claims_provider props deprecate old cols in mart definition --- .../models/mart/benefits/_mart_benefits.yml | 8 +++++++- .../mart/benefits/fct_benefits_events.sql | 18 ++++++++++++++++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/warehouse/models/mart/benefits/_mart_benefits.yml b/warehouse/models/mart/benefits/_mart_benefits.yml index b6e37adfa3..b6bd5b51bc 100644 --- a/warehouse/models/mart/benefits/_mart_benefits.yml +++ b/warehouse/models/mart/benefits/_mart_benefits.yml @@ -56,7 +56,13 @@ models: - name: processed_time description: UTC ISO-8601 timestamp - name: event_properties_auth_provider - description: The `auth_provider` value from the `event_properties` column + description: The `claims_provider` value from the `event_properties` column + deprecated: + enabled: true + reason: "This column is deprecated, use `event_properties_claims_provider` instead" + date: "2024-10-10" + - name: event_properties_claims_provider + description: The `claims_provider` value from the `event_properties` column - name: event_properties_card_tokenize_func description: The `card_tokenize_func` value from the `event_properties` column - name: event_properties_card_tokenize_url diff --git a/warehouse/models/mart/benefits/fct_benefits_events.sql b/warehouse/models/mart/benefits/fct_benefits_events.sql index fd5f8149af..e9f8d7c862 100644 --- a/warehouse/models/mart/benefits/fct_benefits_events.sql +++ b/warehouse/models/mart/benefits/fct_benefits_events.sql @@ -34,7 +34,6 @@ WITH fct_benefits_events AS ( processed_time, -- Event Properties (https://app.amplitude.com/data/compiler/Benefits/properties/main/latest/event) - {{ json_extract_column('event_properties', 'auth_provider') }}, {{ json_extract_column('event_properties', 'card_tokenize_func') }}, {{ json_extract_column('event_properties', 'card_tokenize_url') }}, {{ json_extract_column('event_properties', 'eligibility_verifier') }}, @@ -49,6 +48,15 @@ WITH fct_benefits_events AS ( {{ json_extract_column('event_properties', 'status') }}, {{ json_extract_column('event_properties', 'transit_agency') }}, + -- Historical data existed in `auth_provider` but new data is in `claims_provider` + -- https://github.com/cal-itp/benefits/pull/2401 + COALESCE( + {{ json_extract_column('event_properties', 'claims_provider', no_alias = true) }}, + {{ json_extract_column('event_properties', 'auth_provider', no_alias = true) }} + ) AS event_properties_claims_provider, + -- include the old field as well, deprecated in the mart definition + event_properties_claims_provider AS event_properties_auth_provider, + -- Historical data existed in `eligibility_types` but new data is in `enrollment_flows` -- https://github.com/cal-itp/benefits/pull/2379 COALESCE( @@ -112,7 +120,13 @@ fct_old_enrollments AS ( start_version, uuid, processed_time, - event_properties_auth_provider, + CASE + WHEN client_event_time < '2022-08-12T07:00:00Z' + THEN "ca-dmv" + WHEN client_event_time >= '2022-08-12T07:00:00Z' + THEN "cdt-logingov" + END as event_properties_claims_provider, + event_properties_claims_provider as event_properties_auth_provider, event_properties_card_tokenize_func, event_properties_card_tokenize_url, CASE From ec62b1ef6bfd2b4b2c6b683e5669ec588967ead0 Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Thu, 10 Oct 2024 16:52:59 +0000 Subject: [PATCH 5/9] refactor(benefits): coalesce enrollment_group props deprecate old cols in mart definition --- warehouse/models/mart/benefits/_mart_benefits.yml | 8 +++++++- .../models/mart/benefits/fct_benefits_events.sql | 13 +++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/warehouse/models/mart/benefits/_mart_benefits.yml b/warehouse/models/mart/benefits/_mart_benefits.yml index b6bd5b51bc..a0190772a3 100644 --- a/warehouse/models/mart/benefits/_mart_benefits.yml +++ b/warehouse/models/mart/benefits/_mart_benefits.yml @@ -84,7 +84,13 @@ models: - name: event_properties_path description: The `path` value from the `event_properties` column - name: event_properties_payment_group - description: The `payment_group` value from the `event_properties` column + description: The `enrollment_group` value from the `event_properties` column + deprecated: + enabled: true + reason: "This column is deprecated, use `event_properties_enrollment_group` instead" + date: "2024-10-10" + - name: event_properties_enrollment_group + description: The `enrollment_group` value from the `event_properties` column - name: event_properties_status description: The `status` value from the `event_properties` column - name: event_properties_transit_agency diff --git a/warehouse/models/mart/benefits/fct_benefits_events.sql b/warehouse/models/mart/benefits/fct_benefits_events.sql index e9f8d7c862..c49d9a6307 100644 --- a/warehouse/models/mart/benefits/fct_benefits_events.sql +++ b/warehouse/models/mart/benefits/fct_benefits_events.sql @@ -44,7 +44,6 @@ WITH fct_benefits_events AS ( {{ json_extract_column('event_properties', 'language') }}, {{ json_extract_column('event_properties', 'origin') }}, {{ json_extract_column('event_properties', 'path') }}, - {{ json_extract_column('event_properties', 'payment_group') }}, {{ json_extract_column('event_properties', 'status') }}, {{ json_extract_column('event_properties', 'transit_agency') }}, @@ -66,6 +65,15 @@ WITH fct_benefits_events AS ( -- include the old field as well, deprecated in the mart definition event_properties_enrollment_flows AS event_properties_eligibility_types, + -- Historical data existed in `payment_group` but new data is in `enrollment_group` + -- https://github.com/cal-itp/benefits/pull/2391 + COALESCE( + {{ json_extract_flattened_column('event_properties', 'enrollment_group', no_alias = true) }}, + {{ json_extract_flattened_column('event_properties', 'payment_group', no_alias = true) }} + ) AS event_properties_enrollment_group, + -- include the old field as well, deprecated in the mart definition + event_properties_enrollment_group AS event_properties_payment_group, + -- User Properties (https://app.amplitude.com/data/compiler/Benefits/properties/main/latest/user) {{ json_extract_column('user_properties', 'eligibility_verifier') }}, {{ json_extract_column('user_properties', 'initial_referrer') }}, @@ -142,7 +150,8 @@ fct_old_enrollments AS ( event_properties_language, event_properties_origin, event_properties_path, - "5170d37b-43d5-4049-899c-b4d850e14990" as event_properties_payment_group, + "5170d37b-43d5-4049-899c-b4d850e14990" as event_properties_enrollment_group, + event_properties_enrollment_group as event_properties_payment_group, "success" as event_properties_status, "Monterey-Salinas Transit" as event_properties_transit_agency, "senior" as event_properties_enrollment_flows, From 3e268753e114846d232d7e20a6416cc81f2cc0a2 Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Thu, 10 Oct 2024 17:26:25 +0000 Subject: [PATCH 6/9] refactor(benefits): rename card tokenization events --- warehouse/models/mart/benefits/fct_benefits_events.sql | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/warehouse/models/mart/benefits/fct_benefits_events.sql b/warehouse/models/mart/benefits/fct_benefits_events.sql index c49d9a6307..104d10a433 100644 --- a/warehouse/models/mart/benefits/fct_benefits_events.sql +++ b/warehouse/models/mart/benefits/fct_benefits_events.sql @@ -12,6 +12,10 @@ WITH fct_benefits_events AS ( case when event_type = "selected eligibility verifier" then "selected enrollment flow" + when event_type = "started payment connection" + then "started card tokenization" + when event_type = "closed payment connection" or event_type = "ended card tokenization" + then "finished card tokenization" else event_type end as event_type, version_name, From 4f305e05f05fcb76e5b349ac48467724d018a040 Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Thu, 10 Oct 2024 17:41:07 +0000 Subject: [PATCH 7/9] feat(benefits): add new enrollment_method cols default to 'digital' for historical events --- .../models/mart/benefits/_mart_benefits.yml | 4 ++++ .../models/mart/benefits/fct_benefits_events.sql | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/warehouse/models/mart/benefits/_mart_benefits.yml b/warehouse/models/mart/benefits/_mart_benefits.yml index a0190772a3..bcbd727c58 100644 --- a/warehouse/models/mart/benefits/_mart_benefits.yml +++ b/warehouse/models/mart/benefits/_mart_benefits.yml @@ -55,6 +55,8 @@ models: description: UUID - name: processed_time description: UTC ISO-8601 timestamp + - name: event_properties_enrollment_method + description: The `enrollment_method` value from the `event_properties` column - name: event_properties_auth_provider description: The `claims_provider` value from the `event_properties` column deprecated: @@ -103,6 +105,8 @@ models: date: "2024-09-19" - name: event_properties_enrollment_flows description: A semi-colon delimited list of `enrollment_flows` values from the `event_properties` column + - name: user_properties_enrollment_method + description: The `enrollment_method` value from the `user_properties` column - name: user_properties_eligibility_verifier description: The `eligibility_verifier` value from the `user_properties` column - name: user_properties_initial_referrer diff --git a/warehouse/models/mart/benefits/fct_benefits_events.sql b/warehouse/models/mart/benefits/fct_benefits_events.sql index 104d10a433..56a7e6f844 100644 --- a/warehouse/models/mart/benefits/fct_benefits_events.sql +++ b/warehouse/models/mart/benefits/fct_benefits_events.sql @@ -51,6 +51,13 @@ WITH fct_benefits_events AS ( {{ json_extract_column('event_properties', 'status') }}, {{ json_extract_column('event_properties', 'transit_agency') }}, + -- New column `enrollment_method`, historical values should be set to "digital" + -- https://github.com/cal-itp/benefits/pull/2402 + COALESCE( + {{ json_extract_column('event_properties', 'enrollment_method', no_alias = true) }}, + "digital" + ) AS event_properties_enrollment_method, + -- Historical data existed in `auth_provider` but new data is in `claims_provider` -- https://github.com/cal-itp/benefits/pull/2401 COALESCE( @@ -94,6 +101,13 @@ WITH fct_benefits_events AS ( {{ json_extract_column('user_properties', 'referring_domain') }}, {{ json_extract_column('user_properties', 'user_agent') }}, + -- New column `enrollment_method`, historical values should be set to "digital" + -- https://github.com/cal-itp/benefits/pull/2402 + COALESCE( + {{ json_extract_column('user_properties', 'enrollment_method', no_alias = true) }}, + "digital" + ) AS user_properties_enrollment_method, + -- Historical data existed in `eligibility_types` but new data is in `enrollment_flows` -- https://github.com/cal-itp/benefits/pull/2379 COALESCE( @@ -132,6 +146,7 @@ fct_old_enrollments AS ( start_version, uuid, processed_time, + "digital" as event_properties_enrollment_method, CASE WHEN client_event_time < '2022-08-12T07:00:00Z' THEN "ca-dmv" @@ -160,6 +175,7 @@ fct_old_enrollments AS ( "Monterey-Salinas Transit" as event_properties_transit_agency, "senior" as event_properties_enrollment_flows, event_properties_enrollment_flows as event_properties_eligibility_types, + "digital" as user_properties_enrollment_method, CASE WHEN client_event_time < '2022-08-12T07:00:00Z' THEN "ca-dmv" From 25128952fdcb7666d745466b56a4cb906aff7f97 Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Thu, 10 Oct 2024 17:50:02 +0000 Subject: [PATCH 8/9] fix(benefits): correct app versions caused by a bug in the Docker build process --- .../mart/benefits/fct_benefits_events.sql | 36 +++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/warehouse/models/mart/benefits/fct_benefits_events.sql b/warehouse/models/mart/benefits/fct_benefits_events.sql index 56a7e6f844..b3dd34680c 100644 --- a/warehouse/models/mart/benefits/fct_benefits_events.sql +++ b/warehouse/models/mart/benefits/fct_benefits_events.sql @@ -18,7 +18,23 @@ WITH fct_benefits_events AS ( then "finished card tokenization" else event_type end as event_type, - version_name, + -- Fix bug in Docker build process resulting in incorrect version strings + -- https://github.com/cal-itp/benefits/pull/2392 + case + when version_name = "2024.7.3.dev0+gcd3b083.d20240731" + then "2024.7.2" + when version_name = "2024.8.2.dev0+g7664917.d20240821" + then "2024.8.1" + when version_name = "2024.9.2.dev0+gadf41b9.d20240909" + then "2024.9.1" + when version_name = "2024.9.3.dev0+gfeb06d2.d20240918" + then "2024.9.2" + when version_name = "2024.9.4.dev0+g861519e.d20240926" + then "2024.9.3" + when version_name = "2024.10.2.dev0+g158e1b0.d20241010" + then "2024.10.1" + else version_name + end as version_name, os_name, os_version, device_family, @@ -33,7 +49,23 @@ WITH fct_benefits_events AS ( server_upload_time, server_received_time, amplitude_id, - start_version, + -- Fix bug in Docker build process resulting in incorrect version strings + -- https://github.com/cal-itp/benefits/pull/2392 + case + when start_version = "2024.7.3.dev0+gcd3b083.d20240731" + then "2024.7.2" + when start_version = "2024.8.2.dev0+g7664917.d20240821" + then "2024.8.1" + when start_version = "2024.9.2.dev0+gadf41b9.d20240909" + then "2024.9.1" + when start_version = "2024.9.3.dev0+gfeb06d2.d20240918" + then "2024.9.2" + when start_version = "2024.9.4.dev0+g861519e.d20240926" + then "2024.9.3" + when start_version = "2024.10.2.dev0+g158e1b0.d20241010" + then "2024.10.1" + else start_version + end as start_version, uuid, processed_time, From 34aa4a0379672b9936a71b7c8805fd299f14bd16 Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Mon, 21 Oct 2024 12:38:26 -0700 Subject: [PATCH 9/9] fix(benefits): remove aliases for old columns causing a DBT build error --- .../models/mart/benefits/fct_benefits_events.sql | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/warehouse/models/mart/benefits/fct_benefits_events.sql b/warehouse/models/mart/benefits/fct_benefits_events.sql index b3dd34680c..fafc3ab706 100644 --- a/warehouse/models/mart/benefits/fct_benefits_events.sql +++ b/warehouse/models/mart/benefits/fct_benefits_events.sql @@ -96,8 +96,6 @@ WITH fct_benefits_events AS ( {{ json_extract_column('event_properties', 'claims_provider', no_alias = true) }}, {{ json_extract_column('event_properties', 'auth_provider', no_alias = true) }} ) AS event_properties_claims_provider, - -- include the old field as well, deprecated in the mart definition - event_properties_claims_provider AS event_properties_auth_provider, -- Historical data existed in `eligibility_types` but new data is in `enrollment_flows` -- https://github.com/cal-itp/benefits/pull/2379 @@ -105,8 +103,6 @@ WITH fct_benefits_events AS ( {{ json_extract_flattened_column('event_properties', 'enrollment_flows', no_alias = true) }}, {{ json_extract_flattened_column('event_properties', 'eligibility_types', no_alias = true) }} ) AS event_properties_enrollment_flows, - -- include the old field as well, deprecated in the mart definition - event_properties_enrollment_flows AS event_properties_eligibility_types, -- Historical data existed in `payment_group` but new data is in `enrollment_group` -- https://github.com/cal-itp/benefits/pull/2391 @@ -114,8 +110,6 @@ WITH fct_benefits_events AS ( {{ json_extract_flattened_column('event_properties', 'enrollment_group', no_alias = true) }}, {{ json_extract_flattened_column('event_properties', 'payment_group', no_alias = true) }} ) AS event_properties_enrollment_group, - -- include the old field as well, deprecated in the mart definition - event_properties_enrollment_group AS event_properties_payment_group, -- User Properties (https://app.amplitude.com/data/compiler/Benefits/properties/main/latest/user) {{ json_extract_column('user_properties', 'eligibility_verifier') }}, @@ -145,9 +139,7 @@ WITH fct_benefits_events AS ( COALESCE( {{ json_extract_flattened_column('user_properties', 'enrollment_flows', no_alias = true) }}, {{ json_extract_flattened_column('user_properties', 'eligibility_types', no_alias = true) }} - ) AS user_properties_enrollment_flows, - -- include the old field as well, deprecated in the mart definition - user_properties_enrollment_flows as user_properties_eligibility_types + ) AS user_properties_enrollment_flows FROM {{ ref('stg_amplitude__benefits_events') }} ), @@ -185,7 +177,6 @@ fct_old_enrollments AS ( WHEN client_event_time >= '2022-08-12T07:00:00Z' THEN "cdt-logingov" END as event_properties_claims_provider, - event_properties_claims_provider as event_properties_auth_provider, event_properties_card_tokenize_func, event_properties_card_tokenize_url, CASE @@ -202,11 +193,9 @@ fct_old_enrollments AS ( event_properties_origin, event_properties_path, "5170d37b-43d5-4049-899c-b4d850e14990" as event_properties_enrollment_group, - event_properties_enrollment_group as event_properties_payment_group, "success" as event_properties_status, "Monterey-Salinas Transit" as event_properties_transit_agency, "senior" as event_properties_enrollment_flows, - event_properties_enrollment_flows as event_properties_eligibility_types, "digital" as user_properties_enrollment_method, CASE WHEN client_event_time < '2022-08-12T07:00:00Z' @@ -220,8 +209,7 @@ fct_old_enrollments AS ( user_properties_user_agent, user_properties_referrer, user_properties_referring_domain, - "senior" as user_properties_enrollment_flows, - user_properties_enrollment_flows as user_properties_eligibility_types + "senior" as user_properties_enrollment_flows FROM fct_benefits_events WHERE client_event_time >= '2021-12-08T08:00:00Z' and client_event_time < '2022-08-29T07:00:00Z'