Lesson 2: Four gates between a messy export and data you can trust
19 min read·13 Oct 2026
Module 2 · Lesson 2 · About 40 minutes · Needs: Lesson 1 of this module (pandas, missing and duplicate data) and Module 1 (Python classes, dictionaries)
The situation
Priya exports the help centre for the assistant. It has 16 records, not 12. Someone kept an old copy of the returns article, a spreadsheet turned one id into a number, one record lost its category, and an agent once pasted a customer's email and phone number into the "charged twice" article.
Nothing in that export crashes. Every record loads. Bad data that loads quietly becomes bad answers quietly. This lesson builds four gates in plain Python and passes the export through them; twelve clean, versioned articles come out.