mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-27 23:35:01 +00:00
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:
parent
44b39239a4
commit
56534617de
1 changed files with 7 additions and 1 deletions
|
|
@ -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]:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue