From a8afcd1b3daeb2eea37e0928f86b26225befd8da Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Tue, 14 Jul 2026 14:31:32 +0000 Subject: [PATCH] =?UTF-8?q?Strict-raise=20on=20an=20unrecognised=20PasHub?= =?UTF-8?q?=20main-heating=20Fuel=20label=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/mapper.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/datatypes/epc/domain/mapper.py b/datatypes/epc/domain/mapper.py index a9f9e5cae..b3bfdb370 100644 --- a/datatypes/epc/domain/mapper.py +++ b/datatypes/epc/domain/mapper.py @@ -7070,10 +7070,15 @@ _PASHUB_MAIN_FUEL_TO_SAP10: Dict[str, int] = { def _pashub_main_fuel_code(fuel_label: str) -> Union[int, str]: """Resolve a PasHub surveyed main-heating Fuel label to a SAP10 fuel code at the mapper boundary (ADR-0015). A genuinely blank label is the "no main - heating" shape and passes through unchanged.""" + heating" shape and passes through unchanged; a non-empty label the lookup + does not cover strict-raises `UnmappedPasHubLabel` so the gap is fixed here, + never silently mis-billed downstream.""" if not fuel_label: return fuel_label - return _PASHUB_MAIN_FUEL_TO_SAP10.get(fuel_label, fuel_label) + code = _PASHUB_MAIN_FUEL_TO_SAP10.get(fuel_label) + if code is None: + raise UnmappedPasHubLabel("main fuel", fuel_label) + return code def _resolve_elmhurst_underfloor_subtype(