DT2: Data quality you can prove

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

Counts that add up

🎯You'll be able to

Reconcile a load so every row read is accounted for, compare totals with an independent source, and log the counts of every run.

🏠The everyday picture

At the end of the day a shop counts the cash and checks it against the sales slips. If they don't agree, the shop doesn't close until it knows why.

📘What it really is

rows read = rows loaded + rows quarantined + exact repeats + rows left out on purpose.

If the two sides differ, rows were lost or invented somewhere, and the load should fail.

📝A worked example

Input: after loading all 30 days, run select sum(rows_in), sum(rows_loaded), sum(rows_quarantined), sum(rows_duplicate), sum(rows_test) from ops.load_log where status = 'ok'.

Expected output: 10660, 10181, 90, 329, 60, and 10,181 + 90 + 329 + 60 = 10,660. A separate script that reads the raw files with Python's csv module, without the pipeline's code, also finds 10,181 lines and ₹19,65,764 of delivered sales. Both were checked on 1 November 2026.

🌍Where it's used

📝Case scenario

A school board moved exam results to a new system. Row counts matched, but a reconciliation of total marks per school showed one school was 9,000 marks short: a subject's marks had been loaded into the wrong column for 300 students. Counts alone would have passed.

🖱️Try it

Load 5 October with the solution's pipeline and check the reconciliation for that day by hand from the log. Success: 317 = 302 + 3 + 10 + 2.

⚠️Common mistakes

🛠️For your project

Project 1 test 6 checks the reconciliation for every load, and test 9 checks a failed run is logged.

✅Quick check

Write the row reconciliation equation.

Show the answer

Rows read = loaded + quarantined + repeats + rows left out on purpose.

Why is an independent check better than re-running the same code?

Show the answer

The same code repeats the same mistakes; a different method can catch them.

← PreviousValidation rules and quarantine
ProLearners Assist