@@ -41,12 +41,12 @@ def run_module():
4141 wip_signal = params ["wip_signal" ]
4242 cache_dir = params ["cache_dir" ]
4343
44- # arch_diff = S3ArchiveDiffer(
45- # cache_dir, export_dir,
46- # params["bucket_name"], "ght",
47- # params["aws_credentials"])
48- # arch_diff.update_cache()
49- # print(arch_diff)
44+ arch_diff = S3ArchiveDiffer (
45+ cache_dir , export_dir ,
46+ params ["bucket_name" ], "ght" ,
47+ params ["aws_credentials" ])
48+ arch_diff .update_cache ()
49+ print (arch_diff )
5050 # if missing start_date, set to today (GMT) minus 5 days
5151 if start_date == "" :
5252 now = datetime .datetime .now (datetime .timezone .utc )
@@ -100,18 +100,18 @@ def run_module():
100100 start_date = start_date , receiving_dir = export_dir )
101101 export_csv (df_msa , MSA , signal , smooth = False ,
102102 start_date = start_date , receiving_dir = export_dir )
103- # # Diff exports, and make incremental versions
104- # _, common_diffs, new_files = arch_diff.diff_exports()
105- #
106- # # Archive changed and new files only
107- # to_archive = [f for f, diff in common_diffs.items() if diff is not None]
108- # to_archive += new_files
109- # _, fails = arch_diff.archive_exports(to_archive)
110- #
111- # # Filter existing exports to exclude those that failed to archive
112- # succ_common_diffs = {f: diff for f, diff in common_diffs.items() if f not in fails}
113- # arch_diff.filter_exports(succ_common_diffs)
114- #
115- # # Report failures: someone should probably look at them
116- # for exported_file in fails:
117- # print(f"Failed to archive '{exported_file}'")
103+ # Diff exports, and make incremental versions
104+ _ , common_diffs , new_files = arch_diff .diff_exports ()
105+
106+ # Archive changed and new files only
107+ to_archive = [f for f , diff in common_diffs .items () if diff is not None ]
108+ to_archive += new_files
109+ _ , fails = arch_diff .archive_exports (to_archive )
110+
111+ # Filter existing exports to exclude those that failed to archive
112+ succ_common_diffs = {f : diff for f , diff in common_diffs .items () if f not in fails }
113+ arch_diff .filter_exports (succ_common_diffs )
114+
115+ # Report failures: someone should probably look at them
116+ for exported_file in fails :
117+ print (f"Failed to archive '{ exported_file } '" )
0 commit comments