feat(pipeline): derive dim_school.has_sixth_form from GIAS flag
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -16,6 +16,17 @@ models:
|
||||
tests:
|
||||
- not_null:
|
||||
severity: warn
|
||||
- name: has_sixth_form
|
||||
description: >
|
||||
Authoritative sixth-form flag from GIAS OfficialSixthForm.
|
||||
"Has a sixth form" => true; "Does not have a sixth form" and
|
||||
"Not applicable" => false; blank GIAS value falls back to
|
||||
statutory_high_age >= 18. Replaces the age_range-contains-"18"
|
||||
heuristic (spec 2026-07-07 §3).
|
||||
tests:
|
||||
- not_null
|
||||
- accepted_values:
|
||||
values: [true, false]
|
||||
- name: status
|
||||
tests:
|
||||
- accepted_values:
|
||||
|
||||
@@ -52,6 +52,14 @@ select
|
||||
s.religious_character,
|
||||
s.gender,
|
||||
s.statutory_low_age || '-' || s.statutory_high_age as age_range,
|
||||
-- Authoritative sixth-form flag (spec §3): GIAS OfficialSixthForm.
|
||||
-- "Not applicable" (nurseries, primaries, PRUs) => false. Blank GIAS
|
||||
-- value (rare, new establishments) falls back to the statutory age range.
|
||||
case
|
||||
when s.official_sixth_form = 'Has a sixth form' then true
|
||||
when s.official_sixth_form in ('Does not have a sixth form', 'Not applicable') then false
|
||||
else coalesce(s.statutory_high_age >= 18, false)
|
||||
end as has_sixth_form,
|
||||
s.capacity,
|
||||
s.total_pupils,
|
||||
concat_ws(' ', s.head_title, s.head_first_name, s.head_last_name) as headteacher_name,
|
||||
|
||||
Reference in New Issue
Block a user