Files
school_compare/pipeline/transform/dbt_project.yml
T
TudorandClaude Opus 5 7650b16f62 feat(data): publish England only, dropping Welsh and overseas establishments
GIAS ships the whole UK plus overseas and offshore establishments. None of
them carry comparable DfE performance data — Wales does not publish on the
English measures at all — so every one of these pages rendered with null
results, null Ofsted and null phase. There were 2,036 of them: 1,569 Welsh,
123 offshore (Jersey, Guernsey, Isle of Man, Gibraltar), 316 British schools
overseas and 28 service children's schools. All 2,036 were being submitted to
search engines, alongside 29 local authorities that existed in the filters
purely to list them.

Filter at the mart boundary rather than the view layer. dim_school and
dim_location both exclude TypeOfEstablishment in {25, 26, 30, 37}, listed once
as vars.non_england_school_type_codes. Everything downstream reads those two
marts — search, the school page, /api/filters, rankings, Typesense and
build_sitemap() — so one filter removes them from the site and the sitemap
together, and Typesense drops them on its next rebuild since it recreates the
collection and swaps the alias rather than upserting in place.

coalesce rather than a bare NOT IN: a null type code would make the predicate
null and drop the row silently, and an unknown type is not grounds for
exclusion. No establishment has a null type today, but a future GIAS refresh
could ship one and the loss would be invisible.

assert_england_only_schools guards both directions: no excluded type survives
in dim_school, and dim_location holds no URN dim_school lacks — the API
inner-joins them, so the two filters drifting apart would silently shrink the
corpus.

Corpus goes from 27,229 schools to 25,193, and the authority list from 182 to
153. The 1,569 Welsh URLs now 404.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015mWQnpye9F299NVRCCSRvj
2026-08-20 21:46:28 +01:00

47 lines
1.3 KiB
YAML

name: school_compare
version: "1.0.0"
config-version: 2
profile: school_compare
model-paths: ["models"]
macro-paths: ["macros"]
test-paths: ["tests"]
seed-paths: ["seeds"]
target-path: "target"
clean-targets: ["target", "dbt_packages"]
# schoolcompare publishes England only. GIAS ships the whole UK plus overseas
# and offshore establishments, none of which have comparable DfE performance
# data — Wales does not publish on the English measures at all. Excluding them
# at the mart boundary keeps them out of the site, the filter lists and the
# sitemap together. Codes are TypeOfEstablishment, see seeds/gias_code_names.csv.
# 25 = Offshore schools (Jersey, Guernsey, Isle of Man, Gibraltar)
# 26 = Service children's education (BFPO, Fieldwork Overseas)
# 30 = Welsh establishment
# 37 = British schools overseas
# dim_school, dim_location and assert_england_only_schools all read this list.
vars:
non_england_school_type_codes: [25, 26, 30, 37]
models:
school_compare:
staging:
+materialized: view
+schema: staging
intermediate:
+materialized: view
+schema: intermediate
marts:
+materialized: table
+schema: marts
tests:
school_compare:
assert_no_orphaned_facts:
+severity: warn
seeds:
school_compare:
+schema: seeds