fix(dim_school): infer phase from age range for independent schools
All checks were successful
Build and Push Docker Images / Build Backend (FastAPI) (push) Successful in 12s
Build and Push Docker Images / Build Frontend (Next.js) (push) Successful in 50s
Build and Push Docker Images / Build Pipeline (Meltano + dbt + Airflow) (push) Successful in 1m9s
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 12s
Build and Push Docker Images / Build Frontend (Next.js) (push) Successful in 50s
Build and Push Docker Images / Build Pipeline (Meltano + dbt + Airflow) (push) Successful in 1m9s
Build and Push Docker Images / Trigger Portainer Update (push) Successful in 1s
Independent schools have phase='Not applicable' in GIAS. Now infer phase from statutory age range: <=11 → Primary, >=11 → Secondary, spans both → All-through. Falls back to original value if no age data. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -14,7 +14,14 @@ select
|
||||
s.urn,
|
||||
s.local_authority_code * 1000 + s.establishment_number as laestab,
|
||||
s.school_name,
|
||||
s.phase,
|
||||
case
|
||||
when s.phase is not null and s.phase != 'Not applicable' then s.phase
|
||||
when s.statutory_high_age is not null and s.statutory_high_age <= 11 then 'Primary'
|
||||
when s.statutory_low_age is not null and s.statutory_low_age >= 11 then 'Secondary'
|
||||
when s.statutory_low_age is not null and s.statutory_high_age is not null
|
||||
and s.statutory_low_age < 11 and s.statutory_high_age > 11 then 'All-through'
|
||||
else s.phase
|
||||
end as phase,
|
||||
s.school_type,
|
||||
s.academy_trust_name,
|
||||
s.academy_trust_uid,
|
||||
|
||||
Reference in New Issue
Block a user