Records in, records out
In a data engineering Python interview, you usually get a list of records. You group them, count them, remove duplicates or join them.
It is not a puzzle. It is the daily work of the job.
This chapter teaches the way of thinking behind that work. Every job has the same shape: records go in, a function changes them, and records come out.
The examples use the same shop as the SQL chapters: customers, orders and order_items.
In SQL, one line of a table is a row. In Python, we call it a record. SQL NULL is Python None, and both mean "no value".
You do not need to know Python yet. Each new word is explained the first time you see it. In this chapter, you learn to:
- Hold the shop as a list of records, and read one value from a record.
- Loop over the records, and keep only the ones you want.
- Write a function that turns a record into a new record.
- Write a contract: a check on every record that enters your code.
- Choose what to do with a bad record. A bad record is one with a missing field or an unusable value.
- Know when to use SQL, plain Python or pandas. pandas is a Python library, which means a set of ready-made tools, for tables.
