From d011b93c85dbe24970537db3d569fc6bd55c0583 Mon Sep 17 00:00:00 2001 From: Rick Ross Date: Fri, 8 Dec 2023 09:20:21 -0800 Subject: [PATCH] Fixed bug that was writing the wrong list out to the *_REMOVED.csv file --- lib_afc_mosaic/universe_map_file.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib_afc_mosaic/universe_map_file.py b/lib_afc_mosaic/universe_map_file.py index 86795cb..6c84e7b 100644 --- a/lib_afc_mosaic/universe_map_file.py +++ b/lib_afc_mosaic/universe_map_file.py @@ -330,7 +330,10 @@ class AFCMUniverseMapFile: prep_file_name = f"{filename_prefix}_PREPPED.csv" prep_full_pathname = f"/tmp/{prep_file_name}" if len(amplify_rows) > 0: - write_csv_file(prep_full_pathname, amplify_rows[0].keys(), amplify_rows) + try: + write_csv_file(prep_full_pathname, amplify_rows[0].keys(), amplify_rows) + except Exception as ex: + print(f"[WRITING {prep_file_name}] [{str(ex)}]") # write S3 this_s3_key = os.path.join(self.metadata.get("s3_key", ""), prep_file_name) @@ -345,7 +348,10 @@ class AFCMUniverseMapFile: removed_file_name = f"{filename_prefix}_REMOVED.csv" removed_full_pathname = f"/tmp/{removed_file_name}" if len(removed_rows) > 0: - write_csv_file(removed_full_pathname, removed_rows[0].keys(), amplify_rows) + try: + write_csv_file(removed_full_pathname, removed_rows[0].keys(), removed_rows) + except Exception as ex: + print(f"[WRITING {removed_file_name}] [{str(ex)}]") # write S3 this_s3_key = os.path.join(self.metadata.get("s3_key", ""), removed_file_name)