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.

The repository ships with a generator for synthetic orders so anyone can run it. It contains no real customer data.
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.
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.
-- 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