Strip trailing .0 from historic EPC UPRN 🟩

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jun-te Kim 2026-06-29 14:49:08 +00:00
parent be2b71c235
commit b059d55dd2

View file

@ -21,6 +21,10 @@ def _map_historic_epc_pandas_row_to_domain(row: pd.Series) -> HistoricEpc:
for col, val in row.items()
if col.lower() not in _EXTRA_COLS
}
# pandas reads an all-integer UPRN column as float, so the cell stringifies
# to "151020766.0"; the domain UPRN is the bare integer string.
uprn = kwargs.get("uprn", "")
kwargs["uprn"] = uprn[:-2] if uprn.endswith(".0") else uprn
return HistoricEpc(**kwargs)