fix(dim_school): use case-insensitive comparison for phase inference
All checks were successful
Build and Push Docker Images / Build Backend (FastAPI) (push) Successful in 13s
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 1m6s
Build and Push Docker Images / Trigger Portainer Update (push) Successful in 0s

GIAS provides 'Not Applicable' (capital A) but the check used 'Not applicable',
so the case-sensitive != matched true and skipped the age-range inference.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Tudor Sitaru
2026-04-02 15:33:04 +01:00
parent 4c3c3c882d
commit 5b025b98bd

View File

@@ -15,7 +15,7 @@ select
s.local_authority_code * 1000 + s.establishment_number as laestab, s.local_authority_code * 1000 + s.establishment_number as laestab,
s.school_name, s.school_name,
case case
when s.phase is not null and s.phase != 'Not applicable' then s.phase when s.phase is not null and lower(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_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_low_age >= 11 then 'Secondary'
when s.statutory_low_age is not null and s.statutory_high_age is not null when s.statutory_low_age is not null and s.statutory_high_age is not null