Files
school_compare/pipeline/transform/macros/parse_ofsted_grade.sql
Tudor 8f02b5125e
All checks were successful
Build and Push Docker Images / Build Backend (FastAPI) (push) Successful in 35s
Build and Push Docker Images / Build Frontend (Next.js) (push) Successful in 1m9s
Build and Push Docker Images / Build Integrator (push) Successful in 56s
Build and Push Docker Images / Build Kestra Init (push) Successful in 32s
Build and Push Docker Images / Trigger Portainer Update (push) Successful in 1s
feat(pipeline): add Meltano + dbt + Airflow ELT pipeline scaffold
Replaces the hand-rolled integrator with a production-grade ELT pipeline
using Meltano (Singer taps), dbt Core (medallion architecture), and
Apache Airflow (orchestration). Adds Typesense for search and PostGIS
for geospatial queries.

- 6 custom Singer taps (GIAS, EES, Ofsted, Parent View, FBIT, IDACI)
- dbt project: 12 staging, 5 intermediate, 12 mart models
- 3 Airflow DAGs (daily/monthly/annual schedules)
- Typesense sync + batch geocoding scripts
- docker-compose: add Airflow, Typesense; upgrade to PostGIS
- Portainer stack definition matching live deployment topology

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-26 08:37:53 +00:00

14 lines
600 B
SQL

-- Macro: Parse Ofsted grade from various text/numeric representations
{% macro parse_ofsted_grade(column) %}
case
when {{ column }}::text in ('1', 'Outstanding') then 1
when {{ column }}::text in ('2', 'Good') then 2
when {{ column }}::text in ('3', 'Requires improvement', 'Requires Improvement', 'Satisfactory') then 3
when {{ column }}::text in ('4', 'Inadequate') then 4
when {{ column }}::text in ('9', 'SWK', 'Serious Weaknesses') then 4
when {{ column }}::text in ('SM', 'Special Measures') then 4
else null
end
{% endmacro %}