fix(legacy-ks2): strip % suffix from percentage values
All checks were successful
Build and Push Docker Images / Build Backend (FastAPI) (push) Successful in 34s
Build and Push Docker Images / Build Frontend (Next.js) (push) Successful in 1m11s
Build and Push Docker Images / Build Pipeline (Meltano + dbt + Airflow) (push) Successful in 1m37s
Build and Push Docker Images / Trigger Portainer Update (push) Successful in 1s
All checks were successful
Build and Push Docker Images / Build Backend (FastAPI) (push) Successful in 34s
Build and Push Docker Images / Build Frontend (Next.js) (push) Successful in 1m11s
Build and Push Docker Images / Build Pipeline (Meltano + dbt + Airflow) (push) Successful in 1m37s
Build and Push Docker Images / Trigger Portainer Update (push) Successful in 1s
Old DfE CSVs encode percentages as "57%" not "57". The safe_numeric macro rejects non-numeric strings, so strip the suffix before emitting. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -592,7 +592,11 @@ class LegacyKS2Stream(Stream):
|
|||||||
for _, row in df.iterrows():
|
for _, row in df.iterrows():
|
||||||
record = {"year": year_code}
|
record = {"year": year_code}
|
||||||
for old_col, new_col in _LEGACY_KS2_COLUMN_MAP.items():
|
for old_col, new_col in _LEGACY_KS2_COLUMN_MAP.items():
|
||||||
record[new_col] = row.get(old_col, "")
|
val = row.get(old_col, "")
|
||||||
|
# Strip % suffix — old DfE CSVs use "57%" not "57"
|
||||||
|
if isinstance(val, str) and val.endswith("%"):
|
||||||
|
val = val[:-1]
|
||||||
|
record[new_col] = val
|
||||||
yield record
|
yield record
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user