From 7846f9c949a64f133b7f6afa971ba65f37fba2f9 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Tue, 20 Jan 2026 10:34:09 +0000 Subject: [PATCH] Adjust EPC column name to correctly include trailing space --- backend/condition/parsing/lbwf_parser.py | 5 +++-- backend/condition/processor.py | 4 +++- backend/condition/tests/parsing/test_lbwf_parser.py | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/backend/condition/parsing/lbwf_parser.py b/backend/condition/parsing/lbwf_parser.py index 44ae05f7..8d52f6d5 100644 --- a/backend/condition/parsing/lbwf_parser.py +++ b/backend/condition/parsing/lbwf_parser.py @@ -1,6 +1,5 @@ from typing import BinaryIO, Any, Dict, Iterator, List, Tuple from openpyxl import Workbook, load_workbook -from datetime import date from collections import defaultdict from backend.condition.parsing.parser import Parser @@ -40,6 +39,7 @@ class LbwfParser(Parser): ) except Exception as e: logger.error(f"Error mapping LBWF row to asset record: {e}") + continue return assets @@ -66,6 +66,7 @@ class LbwfParser(Parser): ) except Exception as e: logger.error(f"Error mapping LBWF row to house record: {e}") + continue return houses @@ -94,7 +95,7 @@ class LbwfParser(Parser): uprn=LbwfParser._get_uprn_from_address(address, address_to_uprn_map), reference=row[header_indexes["Reference"]], address=address, - epc=row[header_indexes["EPC"]], + epc=row[header_indexes["EPC "]], shdf=row[header_indexes["SHDF"]], house=row[header_indexes["HOSUE"]], fail_decency=row[header_indexes["Fail Decency"]], diff --git a/backend/condition/processor.py b/backend/condition/processor.py index 3939ba08..fb06c888 100644 --- a/backend/condition/processor.py +++ b/backend/condition/processor.py @@ -13,4 +13,6 @@ def process_file(file_stream: BinaryIO, source_key: str) -> None: parser: Parser = select_parser(file_type) # Orchestration - records: List[Any] = parser.parse(file_stream) \ No newline at end of file + records: List[Any] = parser.parse(file_stream) + + print(records) # temp \ No newline at end of file diff --git a/backend/condition/tests/parsing/test_lbwf_parser.py b/backend/condition/tests/parsing/test_lbwf_parser.py index 78dbddad..7556b845 100644 --- a/backend/condition/tests/parsing/test_lbwf_parser.py +++ b/backend/condition/tests/parsing/test_lbwf_parser.py @@ -79,7 +79,7 @@ def lbwf_homes_xlsx_bytes() -> BytesIO: ]) houses = wb.create_sheet("Houses") - houses.append(["Reference", "Address", "EPC", "SHDF", "HOSUE", "Fail Decency"]) + houses.append(["Reference", "Address", "EPC ", "SHDF", "HOSUE", "Fail Decency"]) houses.append([12345, "123 Fake Street, London, A10 1AB", "E", "NO", "HOUSE", 2025]) houses.append([54321, "100 Random Road, London, A10 1AB", "F", "NO", "HOUSE", 2025])