Skip to content

Instantly share code, notes, and snippets.

View tdsmith's full-sized avatar

Tim D. Smith tdsmith

View GitHub Profile
WITH raw_enrollments AS (
SELECT
e.client_id,
`mozfun.map.get_key`(e.event_map_values, 'branch')
AS branch,
min(e.submission_date) AS enrollment_date,
count(e.submission_date) AS num_enrollment_events
FROM
`moz-fx-data-shared-prod.telemetry.events` e
WHERE
CREATE TEMPORARY TABLE enrollments AS (
WITH analysis_windows AS (
(SELECT 0 AS analysis_window_start, 6 AS analysis_window_end)
),
raw_enrollments AS (
SELECT
e.client_id,
`mozfun.map.get_key`(e.event_map_values, 'branch')
AS branch,
[experiment]
enrollment_query = """
SELECT
client_id,
mozfun.map.get_key(experiments, "{{experiment.normandy_slug}}").branch AS branch,
MIN(DATE(submission_timestamp)) AS enrollment_date,
COUNT(*) AS num_enrollments
FROM `moz-fx-data-shared-prod`.messaging_system.cfr
WHERE
message_id LIKE "{{experiment.normandy_slug}}:%"
Validate bug-1671620-message-homepage-remediation-search-value-props-exper-release-82-83.toml
Error evaluating SQL:
1
2 WITH analysis_windows AS (
3 (SELECT 0 AS analysis_window_start, 20 AS analysis_window_end)
4 ),
5 raw_enrollments AS ( SELECT
6 client_id,
7 mozfun.map.get_key(experiments, "bug-1671620-message-homepage-remediation-search-value-props-exper-release-82-83").branch AS branch,
8 MIN(DATE(submission_timestamp)) AS enrollment_date,
additional_properties
client_info
client_info.android_sdk_version
client_info.app_build
client_info.app_channel
client_info.app_display_version
client_info.architecture
client_info.client_id
client_info.device_manufacturer
client_info.device_model
import datetime as dt
from functools import partial
import json
from pathlib import Path
import logging
import attr
from google.cloud import bigquery as bq
from google.cloud import storage as storage
from google.api_core import exceptions as bq_ex
diff --git a/a b/b
index 0e44fc7..588bcde 100644
--- a/a
+++ b/b
@@ -2,6 +2,7 @@ DECLARE start_date DATE DEFAULT '2020-09-01';
WITH video_usage_per_client as (
SELECT
+ normalized_os,
client_id,
WITH events AS (
SELECT
metadata.isp.name = 'Comcast Cable' AS from_comcast,
`moz-fx-data-shared-prod`.udf.deanonymize_event(e).*
FROM
`moz-fx-data-shared-prod`.telemetry.event
CROSS JOIN UNNEST(payload.events.dynamic) e
WHERE DATE(submission_timestamp) BETWEEN '2020-08-11' AND '2020-08-19'
)
1574121600000
1595721600000
null
1576454400000
1568246400000
1509494400000
1575331200000
1554076800000
1587340800000
1581984000000
{
"experiment_url": "https://experimenter.services.mozilla.com/experiments/search-topsites/",
"type": "addon",
"name": "Activity Stream Search TopSites",
"slug": "search-topsites",
"public_name": "TopSites for Search",
"public_description": "We believe we can deliver an enhanced product experience by exposing these Topsites in a new context, allowing users to navigate even more quickly and easily than they can today.",
"status": "Complete",
"client_matching": "Prefs: Exclude users with the following prefs:\r\n\r\nbrowser.newtabpage.activity-stream.feeds.topsites = false\r\nbrowser.privatebrowsing.autostart = true\r\n\r\nExperiments:\r\n\r\nAny additional filters:",
"locales": [],