mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
Adjust EPC column name to correctly include trailing space
This commit is contained in:
parent
01bf0dbd9c
commit
7846f9c949
3 changed files with 7 additions and 4 deletions
|
|
@ -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"]],
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
records: List[Any] = parser.parse(file_stream)
|
||||
|
||||
print(records) # temp
|
||||
|
|
@ -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])
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue