Skip to content

Conversation

@kik-kik
Copy link
Contributor

@kik-kik kik-kik commented Oct 27, 2025

fix: update the source_type filter to ignore casing

In the v2 the value has changed to be Institutional purchase, to be on the safer side just ignoring casing when in this filter.

@kik-kik kik-kik self-assigned this Oct 27, 2025
@kik-kik kik-kik requested a review from SuYoungHong October 27, 2025 19:44
@kik-kik kik-kik added the bug Something isn't working label Oct 27, 2025
@dataops-ci-bot
Copy link

Integration report for "fix: update the source_type filter to ignore casing"

sql.diff

Click to expand!
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/firefox_ios_derived/app_store_funnel_v1/metadata.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_ios_derived/app_store_funnel_v1/metadata.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/firefox_ios_derived/app_store_funnel_v1/metadata.yaml	2025-10-27 19:46:20.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_ios_derived/app_store_funnel_v1/metadata.yaml	2025-10-27 19:46:07.000000000 +0000
@@ -28,9 +28,9 @@
   - workgroup:mozilla-confidential
 references:
   query.sql:
-  - moz-fx-data-bq-fivetran.firefox_app_store_v2_apple_store.apple_store__territory_report
   - moz-fx-data-shared-prod.app_store.firefox_app_store_territory_source_type_report
   - moz-fx-data-shared-prod.app_store.firefox_downloads_territory_source_type_report
+  - moz-fx-data-shared-prod.app_store_v2_syndicate.apple_store_territory_report
   - moz-fx-data-shared-prod.firefox_ios.new_profiles
   - moz-fx-data-shared-prod.static.country_names_v1
 monitoring:
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/firefox_ios_derived/app_store_funnel_v1/query.sql /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_ios_derived/app_store_funnel_v1/query.sql
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/firefox_ios_derived/app_store_funnel_v1/query.sql	2025-10-27 19:46:20.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_ios_derived/app_store_funnel_v1/query.sql	2025-10-27 19:43:03.000000000 +0000
@@ -21,7 +21,7 @@
       `moz-fx-data-shared-prod.app_store.firefox_app_store_territory_source_type_report`
     WHERE
       DATE(`date`) = DATE_SUB(@submission_date, INTERVAL 7 DAY)
-      AND source_type <> 'Institutional Purchase'
+      AND LOWER(source_type) <> "institutional purchase"
       AND app_id = 989804926  -- Filter to only include the Firefox app
     GROUP BY
       `date`,
@@ -38,7 +38,7 @@
       `moz-fx-data-shared-prod.app_store.firefox_downloads_territory_source_type_report`
     WHERE
       DATE(`date`) = DATE_SUB(@submission_date, INTERVAL 7 DAY)
-      AND source_type <> 'Institutional Purchase'
+      AND LOWER(source_type) <> "institutional purchase"
       AND app_id = 989804926  -- Filter to only include the Firefox app
     GROUP BY
       ALL
@@ -65,10 +65,10 @@
     SUM(first_time_downloads) AS first_time_downloads,
     SUM(redownloads) AS redownloads,
   FROM
-    `moz-fx-data-bq-fivetran.firefox_app_store_v2_apple_store.apple_store__territory_report`
+    `moz-fx-data-shared-prod.app_store_v2_syndicate.apple_store_territory_report`
   WHERE
     DATE(date_day) = DATE_SUB(@submission_date, INTERVAL 7 DAY)
-    AND source_type <> 'Institutional Purchase'
+    AND LOWER(source_type) <> "institutional purchase"
     AND app_id = 989804926  -- Filter to only include the Firefox app
   GROUP BY
     ALL

Link to full diff

Copy link

@SuYoungHong SuYoungHong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfect, looks good to me. Thank you!

One suggestion (I don't think it makes a difference, but just to future proof and add consistency):

In line 15
WHEN source_type IN ('App Referrer', 'Unavailable', 'Web Referrer')

can we also do a lower() and make the condition case insensitive?

but other then that, looks perfect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants