DataLane

All stacks · Languages & local engines

Python

pandas, data quality, and pipeline engineering in Python.

Python cover

Related reading

About Python

Python is the connective tissue of every data platform: ingestion scripts, Airflow DAGs, dbt macros, Spark jobs, and the glue between all of them. The difference between a script that works on your laptop and a pipeline that runs unattended for a year is mostly engineering discipline, not syntax.

These tutorials focus on that discipline — typed, tested, dependency-pinned pipeline code; pandas and polars used deliberately instead of by habit; and the packaging and environment practices (uv, lockfiles, containers) that make Friday deploys uneventful.

What you'll learn here

  • Production script structure: config, logging, retries, and exit codes
  • pandas vs polars vs DuckDB for transformation work, with benchmarks
  • Testing pipelines with pytest: fixtures, fakes, and data assertions
  • Modern environment management with uv and reproducible lockfiles
  • Working with APIs, S3, and warehouses without leaking credentials

Frequently asked questions

How much Python does a data engineer actually need?

Comfortable fluency, not CS-competition depth: functions, dataclasses, comprehensions, context managers, typing, and error handling cover most pipeline code. The differentiator is engineering habits — tests, logging, idempotency — not exotic language features.

pandas or polars?

polars for new transformation-heavy code: multi-core, lazy execution, stricter API, and far better performance on GB-scale data. pandas remains fine for small data and unavoidable for its ecosystem. For SQL-shaped work, DuckDB often beats both.

How should I test a data pipeline?

Unit-test transformation functions with small in-memory frames, contract-test inputs (schemas, nullability), and run one end-to-end test against local files or DuckDB in CI. Avoid tests that need production credentials — they rot into permanently-skipped decorations.

What is uv and should I switch?

uv is a Rust-based package and environment manager that replaces pip, virtualenv, and pip-tools with one very fast tool and a real lockfile. For new projects there is little reason not to use it; migrating existing projects is usually an hour of work.

Type hints in pipeline code — worth it?

Yes. Pipelines are long-lived and refactored under pressure; mypy or pyright catches the None-handling and schema-shape mistakes that otherwise surface at 3 a.m. Annotate function boundaries first — full coverage can come later.

New Python posts, straight to your inbox

One email a week with our latest tutorials. No spam.

Newsletter signup is not live yet. Use the contact form if you want to be notified.

↑↓ navigate openesc close