fix: convert NaN/NULL to None and restore record properties structure in tap.py #48

Merged
tudor merged 1 commits from feature/ingest-independent-schools into main 2026-07-16 07:40:28 +00:00
@@ -237,18 +237,15 @@ class OfstedInspectionsStream(Stream):
for _, row in df.iterrows(): for _, row in df.iterrows():
record = {} record = {}
for key in self.schema["properties"].keys():
record[key] = None
for field, col in col_map.items(): for field, col in col_map.items():
val = row.get(col, None) val = row.get(col, None)
if val == 'NULL': if pd.isna(val) or val == 'NULL':
val = None val = None
record[field] = val record[field] = val
# Cast URN # Cast URN
try: try:
record["urn"] = int(record["urn"]) record["urn"] = int(record.get("urn"))
except (ValueError, KeyError, TypeError): except (ValueError, KeyError, TypeError):
continue continue