Skip to content

Commit 15ce75f

Browse files
committed
merge change that didn't make it for some reason
1 parent b92695a commit 15ce75f

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

google_symptoms/delphi_google_symptoms/date_utils.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,18 @@ def generate_num_export_days(params: Dict, logger) -> [int]:
7676
num_export_days = params["indicator"]["num_export_days"]
7777
custom_run = False if not params["common"].get("custom_run") else params["common"].get("custom_run", False)
7878

79-
if num_export_days is None and not custom_run:
79+
if num_export_days is None:
80+
# Generate a list of signals we expect to produce
81+
sensor_names = set(
82+
"_".join([metric, smoother, "search"])
83+
for metric, smoother in product(COMBINED_METRIC, SMOOTHERS)
84+
)
85+
Epidata.auth = ("epidata", params["indicator"]["api_credentials"])
8086
# Fetch metadata to check how recent each signal is
81-
covidcast.use_api_key(params["indicator"]["api_credentials"])
82-
metadata = covidcast.metadata()
83-
# Filter to only those signals we currently want to produce for `google-symptoms`
84-
gs_metadata = metadata[(metadata.data_source == "google-symptoms") & (metadata.signal.isin(sensor_names))]
87+
metadata = Epidata.covidcast_meta()
88+
# Filter to only those we currently want to produce, ignore any old or deprecated signals
89+
gs_metadata = metadata[(metadata.data_source == "google-symptoms") &
90+
(metadata.signal.isin(sensor_names))]
8591

8692
if sensor_names.difference(set(gs_metadata.signal)):
8793
# If any signal not in metadata yet, we need to backfill its full history.

0 commit comments

Comments
 (0)