DT3: Building reliable pipelines

Lesson 5 of 5 · reading 15–25 minutes; practice and project time is on the module page

When things go wrong

🎯You'll be able to

Make failures loud, log enough to diagnose them, alert the right person, and write a short runbook for the common failures.

🏠The everyday picture

A smoke alarm is useful because it's loud and specific: it goes off in the room with the smoke. An alarm that beeps quietly in the basement, or every day for no reason, is soon ignored.

📘What it really is

📝A worked example

Input: python -m pipeline.run --date 2026-10-31 with the solution (there's no file for 31 October), then echo $?.

Expected output: ERROR: no raw file for 2026-10-31 ... and exit code 1. ops.load_log has a failed row for that date with the message missing file orders/2026-10-31.csv, and the earlier days' rows are unchanged. The starter stops with a Python error and logs nothing.

🌍Where it's used

📝Case scenario

An airline's daily bookings file failed to arrive for three days. The loader printed a warning and exited normally, so the scheduler showed green. The revenue team made pricing decisions on three-day-old data. A non-zero exit code and a freshness alert would have flagged it on the first morning.

🖱️Try it

Write a five-line runbook for SabziSathi with three failures: a missing file, a quarantine over 1% of rows, and a dbt build test failure. For each, give the sign, the first check and the fix. Success: someone else could follow it at 6 a.m.

⚠️Common mistakes

🛠️For your project

Project 1 test 9 checks a missing file ends with a non-zero exit code and a failed row in the load log.

✅Quick check

Why does the exit code matter?

Show the answer

The scheduler uses it to decide whether the run failed.

What should happen to the dashboard when checks fail?

Show the answer

Keep the last good version, with a note that new data is delayed.

← PreviousScheduling and orchestration
ProLearners Assist