From 8510ddf1614871c36d93e0a9dba7d203a0675c93 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Mon, 13 Jul 2026 15:08:56 +0000 Subject: [PATCH] =?UTF-8?q?Count=20Calico=20rows=20dropped=20as=20blank=20?= =?UTF-8?q?placeholders=20or=20unmatched=20references=20=F0=9F=9F=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CalicoParser now tracks how many rows it drops for a blank/N-A covering type and how many references it drops for not resolving to a portfolio UPRN, exposed for the load reconciliation report so nothing vanishes silently. Co-Authored-By: Claude Opus 4.8 (1M context) --- infrastructure/condition/parsing/calico_parser.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/infrastructure/condition/parsing/calico_parser.py b/infrastructure/condition/parsing/calico_parser.py index bc41a8c42..e6a106f78 100644 --- a/infrastructure/condition/parsing/calico_parser.py +++ b/infrastructure/condition/parsing/calico_parser.py @@ -36,12 +36,11 @@ class CalicoParser(Parser): rows = sheet.iter_rows(values_only=True) column_index = CalicoParser._column_indexes(next(rows)) - assets = CalicoParser._parse_assets(rows, column_index) + assets = self._parse_assets(rows, column_index) return self._group_assets_into_properties(assets) - @staticmethod def _parse_assets( - rows: Any, column_index: Dict[str, int] + self, rows: Any, column_index: Dict[str, int] ) -> List[CalicoAssetCondition]: assets: List[CalicoAssetCondition] = [] for row in rows: @@ -49,6 +48,7 @@ class CalicoParser(Parser): if covering_type is None: # A blank covering type is a placeholder row (no roof-covering # record captured), not an observation -- drop on parse. + self._blank_placeholder_count += 1 continue assets.append( CalicoAssetCondition( @@ -77,6 +77,7 @@ class CalicoParser(Parser): for reference, grouped_assets in assets_by_ref.items(): uprn = ref_to_uprn.get(str(reference)) if uprn is None: + self._unmatched_reference_count += 1 logger.debug( f"[CalicoParser] No UPRN for asset reference {reference}; dropping" )