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

The real Calico export lodges the literal string "N/A" (not an empty cell) for
placeholder rows; _clean_str now treats N/A-family sentinels as no covering, so
the 1,239 placeholders are dropped on parse (5,346 -> 4,107 real observations).

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

View file

@ -81,12 +81,18 @@ class CalicoParser(Parser):
if isinstance(header, str)
}
# Sentinels Calico lodges in the Type column for a placeholder row (no
# roof-covering record captured), treated as "no covering".
_BLANK_COVERING_SENTINELS = {"", "n/a", "na", "none"}
@staticmethod
def _clean_str(value: object) -> Optional[str]:
if not isinstance(value, str):
return None
stripped = value.strip()
return stripped or None
if stripped.lower() in CalicoParser._BLANK_COVERING_SENTINELS:
return None
return stripped
@staticmethod
def _to_int(value: object) -> Optional[int]: