Transform is where logic lives
Extract pulls bytes; load writes them; transform is where the logic that justifies your team's existence sits. The discipline is to make every transformation explicit, named, and testable — not buried in a 200-line notebook cell.
The four kinds of transform
- Cleaning — fixing types, parsing dates, handling nulls, normalizing strings.
- Deriving — computing new columns from existing ones (
amount_local = amount_usd * fx_rate). - Joining — combining tables.
- Reshaping — pivot, unpivot, group-then-aggregate.
Build them as small named functions that take a DataFrame and return a DataFrame. A pipeline that's raw.pipe(clean).pipe(derive).pipe(join_customers).pipe(reshape) reads as a contract; one that's do_everything(raw) with 200 lines of inline ops doesn't.