From 981d67d52a14797615f7bbb9d116522aa391d4d3 Mon Sep 17 00:00:00 2001 From: QX Teo <37101453+qx-teo@users.noreply.github.com> Date: Tue, 12 Oct 2021 15:01:23 -0400 Subject: [PATCH 1/2] Fix GS files not transferring Added in file extension check to GS files Moved delivery params up one level so that runner can parse delievery params --- _delphi_utils_python/delphi_utils/utils.py | 4 +++- ansible/templates/google_symptoms-params-prod.json.j2 | 6 +++--- google_symptoms/params.json.template | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/_delphi_utils_python/delphi_utils/utils.py b/_delphi_utils_python/delphi_utils/utils.py index c98ab587c..36d87a2f6 100644 --- a/_delphi_utils_python/delphi_utils/utils.py +++ b/_delphi_utils_python/delphi_utils/utils.py @@ -4,6 +4,7 @@ from shutil import copyfile, move import os import sys +import string def read_params(): """Read a file named 'params.json' in the current working directory. @@ -95,4 +96,5 @@ def transfer_files(): delivery_dir = params["delivery"].get("delivery_dir", None) files_to_export = os.listdir(export_dir) for file_name in files_to_export: - move(os.path.join(export_dir, file_name), delivery_dir) + if file_name.endswith(".csv") or file_name.endswith(".CSV"): + move(os.path.join(export_dir, file_name), delivery_dir) diff --git a/ansible/templates/google_symptoms-params-prod.json.j2 b/ansible/templates/google_symptoms-params-prod.json.j2 index 86444bb86..41fd7a641 100644 --- a/ansible/templates/google_symptoms-params-prod.json.j2 +++ b/ansible/templates/google_symptoms-params-prod.json.j2 @@ -41,9 +41,9 @@ "sum_anosmia_ageusia_smoothed_search", "anosmia_smoothed_search" ] - }, - "delivery": { - "delivery_dir": "/common/covidcast/receiving/google-symptoms" } + }, + "delivery": { + "delivery_dir": "/common/covidcast/receiving/google-symptoms" } } diff --git a/google_symptoms/params.json.template b/google_symptoms/params.json.template index 4a8d171c4..ef0c46765 100644 --- a/google_symptoms/params.json.template +++ b/google_symptoms/params.json.template @@ -31,9 +31,9 @@ "sum_anosmia_ageusia_smoothed_search", "anosmia_smoothed_search" ] - }, - "delivery": { - "delivery_dir": "./receiving" } + }, + "delivery": { + "delivery_dir": "./receiving" } } From 999ee54b02cf00f9e1a5a10b03f971dfc2567aad Mon Sep 17 00:00:00 2001 From: QX Teo <37101453+qx-teo@users.noreply.github.com> Date: Tue, 12 Oct 2021 15:07:56 -0400 Subject: [PATCH 2/2] Fix Lint --- _delphi_utils_python/delphi_utils/utils.py | 1 - 1 file changed, 1 deletion(-) diff --git a/_delphi_utils_python/delphi_utils/utils.py b/_delphi_utils_python/delphi_utils/utils.py index 36d87a2f6..0504967bf 100644 --- a/_delphi_utils_python/delphi_utils/utils.py +++ b/_delphi_utils_python/delphi_utils/utils.py @@ -4,7 +4,6 @@ from shutil import copyfile, move import os import sys -import string def read_params(): """Read a file named 'params.json' in the current working directory.