mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-27 23:35:01 +00:00
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:
parent
5c9757ad89
commit
8510ddf161
1 changed files with 4 additions and 3 deletions
|
|
@ -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"
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue