Skip to content

Instantly share code, notes, and snippets.

View tdsmith's full-sized avatar

Tim D. Smith tdsmith

View GitHub Profile
-- bq --format csv query -n 999999999 < query_event.sql > events_hdd.csv
DECLARE slugs ARRAY<STRUCT<slug STRING, name STRING>> DEFAULT [
("bug-1685741-pref-unenrollment-normandy-test-with-no-op-pref-in-fi-nightly-86-100", "string"),
("bug-1685740-pref-unenrollment-normandy-test-with-no-op-pref-in-fi-nightly-86-100", "boolean"),
("bug-1685742-pref-unenrollment-normandy-test-with-no-op-pref-in-fi-nightly-86-100", "integer")
];
DECLARE start_date DATE DEFAULT "2021-01-12";
WITH events AS (
# https://aur.archlinux.org/packages/goredo/
class Goredo < Formula
desc "Go implementation of djb's redo, a Makefile replacement that sucks less"
homepage "http://www.goredo.cypherpunks.ru/"
url "http://www.goredo.cypherpunks.ru/download/goredo-0.11.0.tar.zst"
version "0.11.0"
sha256 "4608B75BC8A3DFB62EF305B5EED0F4B28AD39F64AE46BACEEA8100D90A8666F9"
license "GPL3"
depends_on "go" => :build
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'
)