|
13 | 13 | from delphi_utils import (
|
14 | 14 | create_export_csv,
|
15 | 15 | get_structured_logger,
|
16 |
| - S3ArchiveDiffer, |
17 | 16 | Smoother
|
18 | 17 | )
|
19 | 18 |
|
@@ -93,13 +92,6 @@ def run_module(params: Dict[str, Dict[str, Any]]):
|
93 | 92 | export_dir = params["common"]["export_dir"]
|
94 | 93 | base_url = params["indicator"]["base_url"]
|
95 | 94 |
|
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 |
| - |
103 | 95 | dfs = {metric: pull_usafacts_data(base_url, metric, logger) for metric in METRICS}
|
104 | 96 | for metric, geo_res, sensor, smoother in product(
|
105 | 97 | METRICS, GEO_RESOLUTIONS, SENSORS, SMOOTHERS):
|
@@ -144,23 +136,6 @@ def run_module(params: Dict[str, Dict[str, Any]]):
|
144 | 136 | oldest_final_export_date = min(
|
145 | 137 | oldest_final_export_date, max(exported_csv_dates))
|
146 | 138 |
|
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 |
| - |
164 | 139 | elapsed_time_in_seconds = round(t.time() - start_time, 2)
|
165 | 140 | max_lag_in_days = None
|
166 | 141 | formatted_oldest_final_export_date = None
|
|
0 commit comments