Skip to main content

Checkpoint: Data Pipelines

intermediate20 min readLesson 61 of 169

Combine comprehensions, closures, and key-based sorting into one pipeline.

One checkpoint challenge — no new theory. You will build a small data pipeline: filter → transform → aggregate → rank. This is the daily shape of real data work, and it exercises everything in this module.

Write summarize(transactions) where each transaction is a dict with category and amount. Return a list of (category, total) tuples for positive amounts only, sorted by total descending (ties: alphabetical category). Aim for a solution built from comprehensions and sorted(key=) — no manual index bookkeeping.

Working with AI: ask a mentor for test cases you might be missing (negative amounts? empty input? one category?) before you look at any generated solution — generating tests first is an engineering skill, not a shortcut.