Drop Calico placeholder rows whose covering type is the "N/A" sentinel 🟥

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-07-13 15:01:27 +00:00
parent 78e45f25a9
commit 44b39239a4

View file

@ -40,6 +40,27 @@ def _workbook(rows: List[List[object]]) -> BytesIO:
return buffer
def test_calico_parser_drops_na_sentinel_covering_rows():
# Arrange -- Calico writes the literal string "N/A" for a placeholder row
# (no roof-covering record captured), not an empty cell.
workbook = _workbook(
[
[443, "HOUSE", "31 Venice Avenue", "Roof Covering", "Concrete Tiles",
date(1998, 4, 1), 55, 36],
[438, "FLAT", "137 Brownhill Avenue", "Roof Covering", "N/A",
date(2000, 4, 1), 0, 973],
]
)
parser = CalicoParser(FakeUprnLookup({"443": 100093305101, "438": 100093388053}))
# Act
properties = parser.parse(workbook)
# Assert
references = [asset.asset_reference for prop in properties for asset in prop.assets]
assert references == [443]
def test_calico_parser_drops_rows_with_no_covering_type():
# Arrange
workbook = _workbook(