Skip to content

Commit ea5788c

Browse files
authored
Merge pull request #1180 from cmu-delphi/remove-usafacts-archivediffer
Remove ArchiveDiffer from USAFacts run()
2 parents 53f71e4 + a94a3e8 commit ea5788c

File tree

1 file changed

+0
-25
lines changed
  • usafacts/delphi_usafacts

1 file changed

+0
-25
lines changed

usafacts/delphi_usafacts/run.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
from delphi_utils import (
1414
create_export_csv,
1515
get_structured_logger,
16-
S3ArchiveDiffer,
1716
Smoother
1817
)
1918

@@ -93,13 +92,6 @@ def run_module(params: Dict[str, Dict[str, Any]]):
9392
export_dir = params["common"]["export_dir"]
9493
base_url = params["indicator"]["base_url"]
9594

96-
if "archive" in params:
97-
arch_diff = S3ArchiveDiffer(
98-
params["archive"]["cache_dir"], export_dir,
99-
params["archive"]["bucket_name"], "usafacts",
100-
params["archive"]["aws_credentials"])
101-
arch_diff.update_cache()
102-
10395
dfs = {metric: pull_usafacts_data(base_url, metric, logger) for metric in METRICS}
10496
for metric, geo_res, sensor, smoother in product(
10597
METRICS, GEO_RESOLUTIONS, SENSORS, SMOOTHERS):
@@ -144,23 +136,6 @@ def run_module(params: Dict[str, Dict[str, Any]]):
144136
oldest_final_export_date = min(
145137
oldest_final_export_date, max(exported_csv_dates))
146138

147-
if "archive" in params:
148-
# Diff exports, and make incremental versions
149-
_, common_diffs, new_files = arch_diff.diff_exports()
150-
151-
# Archive changed and new files only
152-
to_archive = [f for f, diff in common_diffs.items() if diff is not None]
153-
to_archive += new_files
154-
_, fails = arch_diff.archive_exports(to_archive)
155-
156-
# Filter existing exports to exclude those that failed to archive
157-
succ_common_diffs = {f: diff for f, diff in common_diffs.items() if f not in fails}
158-
arch_diff.filter_exports(succ_common_diffs)
159-
160-
# Report failures: someone should probably look at them
161-
for exported_file in fails:
162-
print(f"Failed to archive '{exported_file}'")
163-
164139
elapsed_time_in_seconds = round(t.time() - start_time, 2)
165140
max_lag_in_days = None
166141
formatted_oldest_final_export_date = None

0 commit comments

Comments
 (0)