feat: include and mark 'Open, but proposed to close' schools #22

Merged
tudor merged 3 commits from feat/proposed-to-close-schools into main 2026-07-08 21:23:24 +00:00
3 changed files with 7 additions and 3 deletions
Showing only changes of commit de81e9cdbd - Show all commits
@@ -30,7 +30,7 @@ models:
- name: status
tests:
- accepted_values:
values: ["Open"]
values: ["Open", "Open, but proposed to close"]
- name: dim_location
description: School location dimension with PostGIS geometry
@@ -31,4 +31,5 @@ select
else null
end as longitude
from {{ ref('stg_gias_establishments') }} s
where s.status = 'Open'
-- Must match dim_school's status filter exactly (the API inner-joins the two).
where s.status in ('Open', 'Open, but proposed to close')
@@ -91,4 +91,7 @@ from schools s
{% if ofsted_relation is not none %}
left join {{ ref('int_ofsted_latest') }} o on s.urn = o.urn
{% endif %}
where s.status = 'Open'
-- "Open, but proposed to close" schools are still operating (pupils enrolled,
-- results published) — include them; they drop out automatically once GIAS
-- flips them to "Closed" (marts are fully rebuilt each run).
where s.status in ('Open', 'Open, but proposed to close')