Count Calico rows dropped as blank placeholders or unmatched references 🟩

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) <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-07-13 15:08:56 +00:00
parent 5c9757ad89
commit 8510ddf161

View file

@ -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"
)