mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
Strip trailing .0 from historic EPC UPRN 🟩
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
be2b71c235
commit
b059d55dd2
1 changed files with 4 additions and 0 deletions
|
|
@ -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)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue