diff --git a/datatypes/epc/domain/historic_epc_matching.py b/datatypes/epc/domain/historic_epc_matching.py index 86c44b593..ce6d84f79 100644 --- a/datatypes/epc/domain/historic_epc_matching.py +++ b/datatypes/epc/domain/historic_epc_matching.py @@ -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)