diff --git a/jobs/desktop-mobile-mau-2020/desktop_mau/desktop_mau_dau.py b/jobs/desktop-mobile-mau-2020/desktop_mau/desktop_mau_dau.py index 0438a3cf..ff018b33 100644 --- a/jobs/desktop-mobile-mau-2020/desktop_mau/desktop_mau_dau.py +++ b/jobs/desktop-mobile-mau-2020/desktop_mau/desktop_mau_dau.py @@ -27,10 +27,10 @@ DESKTOP_QUERY = (ROOT_DIR / "mau_dau.sql").read_text() DESKTOP_USER_STATE_QUERY = """ -SELECT +SELECT * -FROM - `moz-fx-data-derived-datasets.analysis.xluo_kpi_plot_country_new_or_rescurrected_dau` +FROM + `moz-fx-data-derived-datasets.analysis.xluo_kpi_plot_country_new_or_rescurrected_dau` """ @@ -454,7 +454,8 @@ def plot_dau_mau_ratio(desktop_data): fontdict={"fontsize": 18, "color": "black"}, ) - # axs[1].plot.area([ind_dat["country_x"].isin(country_list)]["date", "country_x", "pcnt"], subplots=True) + # axs[1].plot.area([ind_dat["country_x"]\ + # .isin(country_list)]["date", "country_x", "pcnt"], subplots=True) dat2 = ind_dat[ind_dat["country_x"].isin(country_list)][ ["date", "country_x", "pcnt_MAU"] ].pivot(index="date", columns="country_x", values="pcnt_MAU") diff --git a/jobs/desktop-mobile-mau-2020/mobile_mau/mobile_mau.py b/jobs/desktop-mobile-mau-2020/mobile_mau/mobile_mau.py index 9e67c4be..b5bb3aa6 100644 --- a/jobs/desktop-mobile-mau-2020/mobile_mau/mobile_mau.py +++ b/jobs/desktop-mobile-mau-2020/mobile_mau/mobile_mau.py @@ -57,7 +57,7 @@ def create_table(template, platform, actual, forecast): - 1 ) - data_end_date = actual["date"].max().date() + # data_end_date = actual["date"].max().date() return template.render( platform=platform, @@ -84,7 +84,8 @@ def create_table(template, platform, actual, forecast): def create_plot(platform, y_min, y_max, actuals, forecast, plot_start_date, slice_name): """ - Display a plot given a platform (each mobile product), data for actuals and forecast, and slice (Global or Tier 1). + Display a plot given a platform (each mobile product), + data for actuals and forecast, and slice (Global or Tier 1). """ main_metric_color = "#CA3524" main_metric_color_ci = "#DDDDDD" @@ -185,11 +186,13 @@ def create_plot(platform, y_min, y_max, actuals, forecast, plot_start_date, slic # autosize=force_width is None, # width=force_width, # height=force_height, - title='{} {} MAU at end of day {}'.format( + title="""\ + {} {} MAU at end of day {}\ + """.format( slice_name, platform, data_end_date, - ), + ).strip(), titlefont={ "size": 24, }, diff --git a/jobs/desktop-mobile-mau-2020/requirements.txt b/jobs/desktop-mobile-mau-2020/requirements.txt index 25e66444..dff560a2 100644 --- a/jobs/desktop-mobile-mau-2020/requirements.txt +++ b/jobs/desktop-mobile-mau-2020/requirements.txt @@ -3,6 +3,7 @@ google-cloud-bigquery==1.27.2 google-cloud-bigquery-storage==1.0.0 google-cloud-storage==1.31.0 Jinja2==2.11.3 +flake8==3.8.4 matplotlib==3.3.2 numpy==1.19.2 pandas==1.1.2