From 1db4c4319e2b7992405fb977705a90e8b3fb8618 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Mon, 28 Oct 2024 14:28:27 +0000 Subject: [PATCH] removing raising of exception at end of function --- etl/customers/stonewater/Wave 3 Preparation.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/etl/customers/stonewater/Wave 3 Preparation.py b/etl/customers/stonewater/Wave 3 Preparation.py index 30a23e86..777f96c5 100644 --- a/etl/customers/stonewater/Wave 3 Preparation.py +++ b/etl/customers/stonewater/Wave 3 Preparation.py @@ -128,8 +128,8 @@ def extract_retrofit_pdfs(data_folder_path): pdf_path = os.path.join(data_folder_path, pdf_file) return detect_and_parse_report(pdf_path, pdf_file) - # If no relevant PDF is found, raise an exception - raise FileNotFoundError("No valid report (EPR or Summary) found in the retrofit assessment folder.") + # If no relevant PDF is found, exit + return None def is_energy_report(text): @@ -199,6 +199,10 @@ def main(): } extracted_data.append(summary_data) continue + else: + # Then we have an empty Retrofit Assessment folder + continue + # If no retrofit folder or it was empty, check files in survey_folder summary_data = extract_retrofit_pdfs(survey_folder_path) if summary_data: