|
2 | 2 |
|
3 | 3 | from pyspark.sql import SparkSession |
4 | 4 | import pyspark.sql.functions as fun |
5 | | -import json |
6 | | -from six.moves import urllib |
7 | 5 | import click |
8 | 6 |
|
9 | 7 | MS_FIELDS = [ |
|
24 | 22 | ] |
25 | 23 |
|
26 | 24 |
|
27 | | -def get_test_pilot_addons(): |
28 | | - """ |
29 | | - Fetches all the live test pilot experiments listed in |
30 | | - the experiments.json file. |
31 | | - :return a list of addon_ids |
32 | | - """ |
33 | | - try: |
34 | | - url = "https://testpilot.firefox.com/api/experiments.json" |
35 | | - response = urllib.request.urlopen(url) |
36 | | - data = json.loads(response.read().decode("utf-8")) |
37 | | - all_tp_addons = ["@testpilot-addon"] + [ |
38 | | - i.get("addon_id") for i in data["results"] if i.get("addon_id") |
39 | | - ] |
40 | | - except: # noqa |
41 | | - print("Couldn't fetch experiments.json from testpilot") |
42 | | - all_tp_addons = [] |
43 | | - return all_tp_addons |
44 | | - |
45 | | - |
46 | 25 | def get_dest(output_bucket, output_prefix, output_version, date=None, sample_id=None): |
47 | 26 | """ |
48 | 27 | Stitches together an s3 destination. |
@@ -124,8 +103,7 @@ def add_addon_columns(df): |
124 | 103 | & (~df.foreign_install) |
125 | 104 | & (~df.addon_id.like("%mozilla%")) |
126 | 105 | & (~df.addon_id.like("%cliqz%")) |
127 | | - & (~df.addon_id.like("%@unified-urlbar%")) |
128 | | - & (~df.addon_id.isin(*NON_MOZ_TEST_PILOT_ADDONS)), |
| 106 | + & (~df.addon_id.like("%@unified-urlbar%")), |
129 | 107 | 1, |
130 | 108 | ).otherwise(0), |
131 | 109 | ) |
@@ -186,12 +164,6 @@ def aggregate_addons(df): |
186 | 164 | return addon_aggregates |
187 | 165 |
|
188 | 166 |
|
189 | | -NON_MOZ_TEST_PILOT_ADDONS = set( |
190 | | - [i for i in get_test_pilot_addons() if "mozilla" not in i] |
191 | | -) |
192 | | -DEFAULT_THEME_ID = "{972ce4c6-7e08-4474-a285-3208198ce6fd}" |
193 | | - |
194 | | - |
195 | 167 | @click.command() |
196 | 168 | @click.option("--date", required=True) |
197 | 169 | @click.option("--input-bucket", default="telemetry-parquet") |
|
0 commit comments