Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Incorporate feedback from Bruce"
Browse files Browse the repository at this point in the history
Incorporate feedback from Bruce
alekhyamoz committed Nov 1, 2023
1 parent c8eeac9 commit 75d7fe6
Showing 18 changed files with 135 additions and 244 deletions.
30 changes: 15 additions & 15 deletions dags/bqetl_review_checker.py
Original file line number Diff line number Diff line change
@@ -43,9 +43,9 @@
doc_md=docs,
tags=tags,
) as dag:
firefox_desktop_review_checker_clients__v2 = bigquery_etl_query(
task_id="firefox_desktop_review_checker_clients__v2",
destination_table="review_checker_clients_v2",
firefox_desktop_review_checker_clients__v1 = bigquery_etl_query(
task_id="firefox_desktop_review_checker_clients__v1",
destination_table="review_checker_clients_v1",
dataset_id="firefox_desktop_derived",
project_id="moz-fx-data-shared-prod",
owner="[email protected]",
@@ -58,9 +58,9 @@
depends_on_past=False,
)

firefox_desktop_review_checker_events__v2 = bigquery_etl_query(
task_id="firefox_desktop_review_checker_events__v2",
destination_table="review_checker_events_v2",
firefox_desktop_review_checker_events__v1 = bigquery_etl_query(
task_id="firefox_desktop_review_checker_events__v1",
destination_table="review_checker_events_v1",
dataset_id="firefox_desktop_derived",
project_id="moz-fx-data-shared-prod",
owner="[email protected]",
@@ -73,9 +73,9 @@
depends_on_past=False,
)

firefox_desktop_review_checker_microsurvey__v2 = bigquery_etl_query(
task_id="firefox_desktop_review_checker_microsurvey__v2",
destination_table="review_checker_microsurvey_v2",
firefox_desktop_review_checker_microsurvey__v1 = bigquery_etl_query(
task_id="firefox_desktop_review_checker_microsurvey__v1",
destination_table="review_checker_microsurvey_v1",
dataset_id="firefox_desktop_derived",
project_id="moz-fx-data-shared-prod",
owner="[email protected]",
@@ -130,7 +130,7 @@
pool="DATA_ENG_EXTERNALTASKSENSOR",
)

firefox_desktop_review_checker_clients__v2.set_upstream(
firefox_desktop_review_checker_clients__v1.set_upstream(
wait_for_copy_deduplicate_all
)
wait_for_search_derived__search_clients_daily__v8 = ExternalTaskSensor(
@@ -145,7 +145,7 @@
pool="DATA_ENG_EXTERNALTASKSENSOR",
)

firefox_desktop_review_checker_clients__v2.set_upstream(
firefox_desktop_review_checker_clients__v1.set_upstream(
wait_for_search_derived__search_clients_daily__v8
)
wait_for_telemetry_derived__clients_daily_joined__v1 = ExternalTaskSensor(
@@ -160,11 +160,11 @@
pool="DATA_ENG_EXTERNALTASKSENSOR",
)

firefox_desktop_review_checker_clients__v2.set_upstream(
firefox_desktop_review_checker_clients__v1.set_upstream(
wait_for_telemetry_derived__clients_daily_joined__v1
)

firefox_desktop_review_checker_events__v2.set_upstream(
firefox_desktop_review_checker_events__v1.set_upstream(
wait_for_copy_deduplicate_all
)

@@ -180,10 +180,10 @@
pool="DATA_ENG_EXTERNALTASKSENSOR",
)

firefox_desktop_review_checker_microsurvey__v2.set_upstream(
firefox_desktop_review_checker_microsurvey__v1.set_upstream(
wait_for_clients_first_seen_v2
)
firefox_desktop_review_checker_microsurvey__v2.set_upstream(
firefox_desktop_review_checker_microsurvey__v1.set_upstream(
wait_for_copy_deduplicate_all
)

Original file line number Diff line number Diff line change
@@ -4,4 +4,4 @@ AS
SELECT
*
FROM
`moz-fx-data-shared-prod.firefox_desktop_derived.review_checker_clients_v2`
`moz-fx-data-shared-prod.firefox_desktop_derived.review_checker_clients_v1`
Original file line number Diff line number Diff line change
@@ -4,4 +4,4 @@ AS
SELECT
*
FROM
`moz-fx-data-shared-prod.firefox_desktop_derived.review_checker_events_v2`
`moz-fx-data-shared-prod.firefox_desktop_derived.review_checker_events_v1`
Original file line number Diff line number Diff line change
@@ -4,4 +4,4 @@ AS
SELECT
*
FROM
`moz-fx-data-shared-prod.firefox_desktop_derived.review_checker_microsurvey_v2`
`moz-fx-data-shared-prod.firefox_desktop_derived.review_checker_microsurvey_v1`
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ labels:
schedule: daily
scheduling:
dag_name: bqetl_review_checker
task_name: firefox_desktop_review_checker_clients__v2
task_name: firefox_desktop_review_checker_clients__v1
bigquery:
time_partitioning:
type: day
Original file line number Diff line number Diff line change
@@ -2,8 +2,6 @@ WITH shopping_metrics AS (
SELECT
metrics.uuid.legacy_telemetry_client_id AS legacy_client_id,
client_info.client_id AS client_id,
client_info.os AS os,
client_info.os_version AS os_version,
DATE(submission_timestamp) AS submission_date,
SUM(
CASE
@@ -23,16 +21,6 @@ WITH shopping_metrics AS (
THEN 1
ELSE 0
END AS is_opt_out,
CASE
WHEN metrics.boolean.shopping_settings_has_onboarded = TRUE
THEN 1
ELSE 0
END AS is_onboarded,
CASE
WHEN metrics.boolean.shopping_settings_nimbus_disabled_shopping = TRUE
THEN 1
ELSE 0
END AS is_nimbus_disabled,
normalized_channel,
normalized_country_code,
sample_id
@@ -46,12 +34,8 @@ WITH shopping_metrics AS (
submission_date,
is_opt_in,
is_opt_out,
is_onboarded,
is_nimbus_disabled,
normalized_channel,
normalized_country_code,
os,
os_version,
sample_id
),
active AS (
@@ -112,8 +96,6 @@ joined_data AS (
sm.shopping_product_page_visits,
sm.is_opt_in,
sm.is_opt_out,
sm.is_nimbus_disabled,
sm.is_onboarded,
s.sap,
s.ad_click,
active_agg.active_hours_sum,
Original file line number Diff line number Diff line change
@@ -26,12 +26,6 @@ fields:
- name: is_opt_out
type: INTEGER
mode: NULLABLE
- name: is_nimbus_disabled
type: INTEGER
mode: NULLABLE
- name: is_onboarded
type: INTEGER
mode: NULLABLE
- name: sap
type: INTEGER
mode: NULLABLE
@@ -42,5 +36,5 @@ fields:
type: FLOAT
mode: NULLABLE
- name: is_fx_dau
type: STRING
mode: INTEGER
type: INTEGER
mode: NULLABLE
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ labels:
schedule: daily
scheduling:
dag_name: bqetl_review_checker
task_name: firefox_desktop_review_checker_events__v2
task_name: firefox_desktop_review_checker_events__v1
bigquery:
time_partitioning:
type: day
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
SELECT
DATE(submission_timestamp) AS submission_date,
client_info.client_id AS client_id,
MAX(CASE WHEN name = 'surface_onboarding_displayed' THEN 1 ELSE 0 END) is_exposed_event,
MAX(CASE WHEN name = 'surface_opt_in_clicked' THEN 1 ELSE 0 END) is_opt_in_event,
MAX(CASE WHEN name = 'surface_displayed' THEN 1 ELSE 0 END) is_surface_displayed,
MAX(
CASE
WHEN name IN (
'surface_analyze_reviews_none_available_clicked',
'surface_learn_more_clicked',
'surface_no_review_reliability_available',
'surface_not_now_clicked',
'surface_powered_by_fakespot_link_clicked',
'surface_reactivated_button_clicked',
'surface_reanalyze_clicked',
'surface_settings_expand_clicked',
'surface_show_more_reviews_button_clicked',
'surface_show_privacy_policy_clicked',
'surface_show_quality_explainer_clicked',
'surface_show_quality_explainer_url_clicked',
'surface_show_terms_clicked'
)
THEN 1
ELSE 0
END
) is_engaged_with_sidebar,
ANY_VALUE(ping_info.experiments) AS experiments,
normalized_channel,
normalized_country_code,
sample_id,
mozfun.norm.truncate_version(client_info.app_display_version, "major") AS os_version,
FROM
`moz-fx-data-shared-prod.firefox_desktop_stable.events_v1` AS e,
UNNEST(events)
WHERE
DATE(submission_timestamp) = @submission_date
AND category = 'shopping'
GROUP BY
DATE(submission_timestamp),
client_info.client_id,
normalized_channel,
normalized_country_code,
sample_id,
os_version
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
fields:
- name: submission_date
type: DATE
mode: NULLABLE
- name: client_id
type: STRING
mode: NULLABLE
- name: is_exposed_event
type: INTERGER
mode: NULLABLE
- name: is_opt_in_event
type: INTERGER
mode: NULLABLE
- name: is_surface_displayed
type: INTERGER
mode: NULLABLE
- name: is_engaged_with_sidebar
type: INTERGER
mode: NULLABLE
- name: experiments
type: RECORD
mode: REPEATED
fields:
- name: key
type: STRING
mode: NULLABLE
- name: value
type: RECORD
mode: NULLABLE
fields:
- name: branch
type: STRING
mode: NULLABLE
- name: extra
type: RECORD
mode: NULLABLE
fields:
- name: enrollment_id
type: STRING
mode: NULLABLE
- name: type
type: STRING
mode: NULLABLE
- name: normalized_channel
type: STRING
mode: NULLABLE
- name: normalized_country_code
type: STRING
mode: NULLABLE
- name: sample_id
type: INTEGER
mode: NULLABLE
- name: os_version
type: INTEGER
mode: NULLABLE

This file was deleted.

Loading

0 comments on commit 75d7fe6

Please sign in to comment.