Skip to content

Conversation

sean-rose
Copy link
Contributor

Description

The other event types already check appropriately whether the subscription is active.

Related Tickets & Documents

  • DENG-9565: Fix some known issues in SubPlat consolidated reporting ETLs
  • DENG-9770: Only generate most logical/service subscription events for active subscriptions

Reviewer, please follow this checklist

@dataops-ci-bot
Copy link

Integration report for "fix(SubPlat): Only generate "Mozilla Account Change" and "Plan Change" events for active subscriptions (DENG-9770)."

sql.diff

Click to expand!
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/subscription_platform_derived/logical_subscription_events_v1_live/view.sql /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/subscription_platform_derived/logical_subscription_events_v1_live/view.sql
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/subscription_platform_derived/logical_subscription_events_v1_live/view.sql	2025-09-29 22:03:20.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/subscription_platform_derived/logical_subscription_events_v1_live/view.sql	2025-09-29 22:00:29.000000000 +0000
@@ -60,6 +60,7 @@
   WHERE
     old_subscription IS NOT NULL
     AND subscription.mozilla_account_id_sha256 IS DISTINCT FROM old_subscription.mozilla_account_id_sha256
+    AND subscription.ended_at IS NULL
 ),
 plan_change_events AS (
   SELECT
@@ -91,6 +92,7 @@
     subscription_changes
   WHERE
     subscription.provider_plan_id != old_subscription.provider_plan_id
+    AND subscription.ended_at IS NULL
 ),
 trial_change_events AS (
   SELECT
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/subscription_platform_derived/service_subscription_events_v1_live/view.sql /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/subscription_platform_derived/service_subscription_events_v1_live/view.sql
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/subscription_platform_derived/service_subscription_events_v1_live/view.sql	2025-09-29 22:03:20.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/subscription_platform_derived/service_subscription_events_v1_live/view.sql	2025-09-29 22:00:29.000000000 +0000
@@ -64,6 +64,7 @@
   WHERE
     old_subscription IS NOT NULL
     AND subscription.mozilla_account_id_sha256 IS DISTINCT FROM old_subscription.mozilla_account_id_sha256
+    AND subscription.ended_at IS NULL
 ),
 plan_change_events AS (
   SELECT
@@ -105,6 +106,7 @@
     subscription_changes
   WHERE
     subscription.provider_plan_id != old_subscription.provider_plan_id
+    AND subscription.ended_at IS NULL
 ),
 trial_change_events AS (
   SELECT

Link to full diff

@sean-rose sean-rose added this pull request to the merge queue Oct 2, 2025
Merged via the queue into main with commit 195308d Oct 2, 2025
22 checks passed
@sean-rose sean-rose deleted the DENG-9770-events-for-active-subscriptions branch October 2, 2025 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants