A pipeline run can end without an error and still be wrong: the export came out empty, or a cleaning rule dropped half the rows. Nobody notices until a report shows a day with no sales. So a data engineer makes every run log its row counts: how many rows it read, how many it wrote, and how many were dropped in between. One line per run, the same shape every day, so an odd day stands out at once.
len(df) is the number of rows in a DataFrame. Count the rows read right after extract, before transform drops any. For the rows written, let load return the length of what it wrote: a returned number can be kept in a variable and used in the log line, a number printed inside load can't.
def save_names(names, path):
open(path, "w").write(", ".join(names))
return len(names)
saved = save_names(["Ana", "Ben", "Cleo"], "names.txt")
print("names.txt", "saved:", saved) # names.txt saved: 3
For this lesson, the hidden setup adds one more export, orders/2026-05-08.csv, which came out empty: it holds only the header line.
order_id,customer_id,product,quantity,unit_price,status,ordered_at
Your code runs 05-01 and 05-03. The check then runs 05-08 and lists the warehouse. 05-03 dropped 2 rows (order 5027 came twice, order 5030 has the quantity "two"). 05-08 read nothing, yet it wrote a folder, and the count of orders per date simply leaves it out:
2026-05-01 in: 10 out: 10 dropped: 0 2026-05-03 in: 12 out: 10 dropped: 2 The check runs 2026-05-08, a day whose export came out empty: 2026-05-08 in: 0 out: 0 dropped: 0 ['date=2026-05-01', 'date=2026-05-03', 'date=2026-05-08'] date | orders 2026-05-01 | 10 2026-05-03 | 10 (2 rows)
Your task: extract, transform and load are written for you, and your code already calls run for 05-01 and 05-03. Make load return how many rows it wrote. In run, keep the rows read in rows_in, call load and keep its answer in rows_out, then print one line: the date, "in:" and the rows read, "out:" and the rows written, "dropped:" and the difference.
Assignment
Follow the Coding Tutorial to count the rows each run reads and writes, and print one log line per run.
Hintprint puts a space between its values, so print(run_date, "in:", rows_in) prints 2026-05-01 in: 10. The dropped count is rows_in - rows_out.
Free plan: 30 tutor messages. PRO is unlimited.
