mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-08-03 05:18:22 +00:00
refetch_epc=True fetched a fresh cert but the recency tie-break (strict >) dropped it whenever the stored row shared the cert's inspection date — so a row written before a schema field/table existed (e.g. room-in-roof geometry) could never be healed by re-fetching. The dwelling was modelled on stale fabric indefinitely. Reconcile instead of just comparing dates: on an equal inspection date, refresh a public gov cert (uploaded_file_id NULL) when the fetched cert differs from the stored one, so a plain re-fetch re-ingests it. One of our own surveys (PasHub / ECMK / Elmhurst — uploaded_file_id set) is preserved on the tie, keeping the survey-wins rule (ADR-0001 / #1589); an unchanged public cert is still not re-persisted. `_reconcile_lodged` layers the content refresh over `_newer_lodged` (recency untouched). New `EpcRepository.survey_lodged_uprns` surfaces the row-level uploaded_file_id provenance the hydrated EpcPropertyData drops. Together with the property_id-anchored persist, a refetch_epc=True re-run now heals both a missing epc_property row and a stale one. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| test_handler.py | ||
| test_predict_epc_errors.py | ||
| test_predict_epc_historic.py | ||