From b059d55dd240517756fe87787dd8b52a4f2967d8 Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Mon, 29 Jun 2026 14:49:08 +0000 Subject: [PATCH] =?UTF-8?q?Strip=20trailing=20.0=20from=20historic=20EPC?= =?UTF-8?q?=20UPRN=20=F0=9F=9F=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 (1M context) --- datatypes/epc/domain/historic_epc_matching.py | 4 ++++ 1 file changed, 4 insertions(+) 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)