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: