---
name: data-pipeline-builder
description: Design and build ETL/ELT data pipelines — sources, staging, transforms, loads, scheduling and data tests — in Dagster, Airflow, Prefect or plain Python, idempotent and incremental. Use for data pipelines, ingestion jobs, ETL, orchestration or 'move data from X to Y every day'.
license: Proprietary — Lendskill original
---

# Data Pipeline Builder

## 1. Design
Sources (API, files, database, stream), destination (warehouse, lake, database), volume, freshness needed (hourly/daily), and who consumes it. Draw the flow: extract → land raw → stage/clean → model → publish.

## 2. Rules that keep pipelines healthy
- **Idempotent**: rerunning a run for the same window gives the same result (upsert/merge or delete-then-insert by partition).
- **Incremental**: process by date partition or high-water mark; support backfills for a date range.
- **Raw is immutable**: land raw data unchanged with load timestamp and source file/batch id.
- **Schema checks** on ingest: expected columns and types; fail loudly on drift.
- **Retries** with backoff for network steps; no retries for data errors.
- Secrets from environment/secret manager, never in code.

## 3. Orchestrator
- Dagster: software-defined assets with partitions, asset checks for tests.
- Airflow: one DAG per pipeline, tasks small, `catchup` deliberate.
- Plain Python + cron/Task Scheduler for small jobs.
Match what the user already runs.

## 4. Tests
Unit tests for transforms with small fixtures; data tests after load: not-null keys, uniqueness, row-count deltas within expected range, referential integrity, freshness.

## 5. Deliver
Code, config, a README (run locally, backfill a range, where logs are), and a run against sample data showing the tests passing.
