Tusharr
← All work Data engineering · Personal project

Mother's Kitchen Orders Pipeline

A daily batch pipeline that turns messy order exports from my meal-subscription business into clean tables and a dashboard: active subscribers, trial conversion, renewals and demand by area.

Role
Data engineer
Year
2026
Stack
Python · PySpark · Spark SQL · Airflow · AWS S3 · Parquet · pytest
Mother's Kitchen Orders Pipeline screenshot

The repository ships with a generator for synthetic orders so anyone can run it. It contains no real customer data.

The challenge

Orders arrive as daily CSV exports that are messy in every way real data is: duplicate rows from re-exports, plan names typed five different ways, prices written as text, phone numbers in mixed formats and the occasional broken row. I wanted answers to business questions (who is active today, who renews, which trials convert) without cleaning spreadsheets by hand.

What I built

A bronze, silver and gold lakehouse in PySpark. Bronze keeps each export exactly as delivered. Silver parses, standardises and deduplicates, replaces phone numbers with a salted hash so no personal data travels further, and sends bad rows to quarantine with a reason. A quality gate stops the run if anything looks wrong. Gold tables are plain SQL files, and an Airflow DAG runs the whole thing nightly with retries.

Key decisions
  • Bronze stores raw strings so ingestion never breaks
  • Quarantine with reasons, never silent drops
  • PII hashed before silver
  • Idempotent tasks: safe retries and backfills
  • Business logic in reviewable SQL files
  • Quality gate before gold
How it flows
ExportDaily CSV
BronzeRaw, append-only
SilverClean, deduped, PII hashed
Quality gateStops bad runs
GoldSQL business tables
Dashboard + S3Published nightly
A gold table, in SQL
-- Subscribers with a paid 15/30-day plan covering each calendar day
WITH calendar AS (
  SELECT explode(sequence(d0, d1, interval 1 day)) AS day FROM bounds
)
SELECT c.day,
       COUNT(DISTINCT CASE WHEN p.plan <> 'trial' THEN p.customer_id END) AS active_subscribers
FROM calendar c
LEFT JOIN plans p ON c.day BETWEEN p.start_date AND p.end_date
GROUP BY c.day
Outcome
204 → 172raw rows to clean orders in the sample run, with 21 duplicates removed and 11 rows quarantined
7automated tests, including an end-to-end run from CSV to dashboard
5gold tables: daily KPIs, active subscribers, funnel, area demand, thali mix