Parameterized Runs and Backfills
Assignment: Build an Orchestrated Data Pipeline
Week 11 Lesson Plan (Teachers)
This class moves students from "pipeline scripts" to "operated workflows." The goal is for every student to leave with a working Airflow DAG that runs locally, supports reruns, can be debugged confidently, and (at Target tier) deploys to the shared class Airflow.
Teaching focus for this cohort: many learners are changing careers and may still be building confidence with technical vocabulary. Keep explanations concrete, repeat key terms, and show one full example before asking students to generalize.
By the end of class, students should be able to:
{{ ds }} / _ds_from_context() and run a small backfill.class-airflow-reference (Target tier).| Time | Activity | Duration |
|---|---|---|
| 0:00 | Welcome + Week 10 recap | 10 min |
| 0:10 | Concept intro: orchestration, DAGs, logical date, {{ ds }} |
20 min |
| 0:30 | Live demo: first DAG in Astro (build, unpause, trigger, inspect logs) | 25 min |
| 0:55 | Break | 10 min |
| 1:05 | Workshop: build sequential + {{ ds }}-parameterized DAG |
45 min |
| 1:50 | Debug lab: intentional failure + log-reading | 25 min |
| 2:15 | Break | 5 min |
| 2:20 | Live demo: deploy to shared Airflow (Ch8 flow, PR to merge to see in UI) | 20 min |
| 2:40 | Gotchas walkthrough + runbook prompt | 10 min |
| 2:50 | Assignment briefing + Q&A | 10 min |
| 3:00 | End |
Total: 3 hours
Use quick check-ins after each major block:
curl -f http://<vm-ip>:8080/api/v2/monitor/health. The VM IP changes on each bicep redeploy; get the current one from az deployment sub show --name <latest-deployment> --query properties.outputs.airflowUrl. If the VM is offline or your cohort has not provisioned one, flag that Minimum-tier students can still complete the assignment locally (see "If the shared VM is down" below).class-airflow-reference is pushable for the students in this cohort (grant them write access to the repo or to a cohort-specific branch).<name>-hyf-<year> from the bicep; rotate once before class.class_demo_hello from class-airflow-reference) and one intentionally broken DAG (e.g. class_demo_hello_broken with an import typo) you can push to dags/ during the Ch8 demo.ingest_taxi_month to dbt_run to dbt_test.astro dev start from a scratch project.hello_pipeline DAG (Ch2 snapshot) manually.Rendered Template tab on a task to preview where {{ ds }} gets substituted; this sets up the debugging demo later._typo suffix to the parquet URL.ingest_taxi_month go red and dbt_run / dbt_test go upstream_failed.HTTPError: 403 Client Error: Forbidden for url:, not the generic "Task failed with exception" above it.class-airflow-reference checkout, copy a class-demo DAG into dags/ (top level, above student subdirs).git pull, the dag-processor re-parses, and the DAG appears.Students extend the Ch5 snapshot into a working taxi_pipeline on their local Astro.
Workshop targets:
ingest_taxi_month to dbt_run to dbt_test.{{ ds }} (or _ds_from_context()) used to pick the partition in the ingest task.retries=2 + retry_delay=timedelta(minutes=2) on default_args.Coaching prompts:
ingest_taxi_month fails?"Support prompts for less technical backgrounds:
Before Q&A, walk the class through the Gotchas & Pitfalls page at high speed. Focus on the ones students are most likely to hit on the assignment:
datetime.now().max_active_runs=1): do not remove it.Remind students that Ch10 ends with a 10-line "audit your own DAG" exercise they should do before submitting.
Map class activities to assignment tasks explicitly: