Model/datatypes/epc/schema
Jun-te Kim 2851a0151b Drop phantom alternative-wall building parts lodged inline (reinstates dropped fix)
Task b9fcd354-2a33-4fc4-a64e-388c060a055c (portfolio 824 / scenario 1278)
still failed 5 of 128 batches with NotNullViolation on
epc_building_part.construction_age_band even after the SAP-Schema-15.0
mapper landed (PR #1531). Cert 8169-6926-5310-0447-8996 (UPRN
100010344955, SAP-Schema-15.0) lodges a bare alternative-wall record
(wall_area/wall_construction/wall_insulation_type, no identifier, age
band, or floor dimensions) as a second sap_building_parts element rather
than under a distinct sap_alternative_wall_1 key. RdSapSchema17_1 (which
the 15.0/16.x reduced-field mappers delegate to) has no alt-wall slot to
route it to, so it persisted as a phantom building part with a null age
band.

_drop_building_parts_without_age_band already solved exactly this shape
of problem for lodging artifacts (ae81a81e), but that commit sits on
fix/drop-building-part-without-age-band, an unmerged branch that has
since drifted far behind main. Reinstating the same filter (fresh, not
cherry-picked) fixes both the original artifact case and this SAP-15
alt-wall case, since RdSapSchema17_1 has nowhere else to put it either
way.

Verified against all 174 properties across the task's originally-failing
batches: zero remaining null-age-band building parts.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-10 11:34:17 +00:00
..
tests Drop phantom alternative-wall building parts lodged inline (reinstates dropped fix) 2026-07-10 11:34:17 +00:00
__init__.py first draft dataclasses with loading tests 2026-04-10 11:33:17 +00:00
common.py first draft dataclasses with loading tests 2026-04-10 11:33:17 +00:00
helpers.py slice 10.5: PhotovoltaicArray on SAP10 schema + EpcPropertyData 2026-05-16 16:00:25 +00:00
rdsap_schema_17_0.py Make nested SapHeating.has_fixed_air_conditioning optional across all RdSAP schemas 2026-07-03 13:09:17 +00:00
rdsap_schema_17_1.py Make nested SapHeating.has_fixed_air_conditioning optional across all RdSAP schemas 2026-07-03 13:09:17 +00:00
rdsap_schema_18_0.py Make nested SapHeating.has_fixed_air_conditioning optional across all RdSAP schemas 2026-07-03 13:09:17 +00:00
rdsap_schema_19_0.py Make nested SapHeating.has_fixed_air_conditioning optional across all RdSAP schemas 2026-07-03 13:09:17 +00:00
rdsap_schema_20_0_0.py Make nested SapHeating.has_fixed_air_conditioning optional across all RdSAP schemas 2026-07-03 13:09:17 +00:00
rdsap_schema_21_0_0.py Make nested SapHeating.has_fixed_air_conditioning optional across all RdSAP schemas 2026-07-03 13:09:17 +00:00
rdsap_schema_21_0_1.py Make RdSapSchema21_0_1.built_form optional — some real certs omit it entirely 2026-07-09 11:24:43 +00:00
sap_schema_17_1.py Full-SAP certs carry their lodged PV export-capability flag 🟩 2026-07-03 12:09:04 +00:00