SPlit up
Some checks failed
CI / Check (push) Failing after 1m58s
Build and publish Docker image / build-and-push (push) Failing after 1m5s

This commit is contained in:
Andras Schmelczer 2026-06-12 21:51:37 +01:00
parent cf39ad754e
commit f59d01227b
91 changed files with 10370 additions and 7562 deletions

View file

@ -241,9 +241,11 @@ def transform(zip_bytes: bytes) -> pl.DataFrame:
"""Convert the GIAS extract ZIP into a clean schools DataFrame."""
raw = _read_csv_from_zip(zip_bytes)
# Filter to currently-open establishments; the CSV also includes closed,
# proposed-to-open, and proposed-to-close rows we do not want on a map.
df = raw.filter(pl.col("EstablishmentStatus (name)") == "Open")
# Filter to currently-open establishments; the CSV also includes closed and
# proposed-to-open rows we do not want on a map. "Open, but proposed to
# close" schools are open, operating establishments (GIAS can keep that
# status for years, e.g. pending amalgamations), so they must stay.
df = raw.filter(pl.col("EstablishmentStatus (name)").str.starts_with("Open"))
df = df.with_columns(
pl.col("URN").cast(pl.Int64),