Databricks PySpark ETL Template — production-ready pipelines, built agentically with Claude Code 🚀 Overview Stop spending weeks on boilerplate. This PySpark project template for Databricks gives you medallion architecture, Python packaging, unit + integration + load tests, CI/CD, DQX data quality, service-principal-based production deploys, and much more — all wired together and ready to ship. Whether you're…
Databricks PySpark ETL Template — production-ready pipelines, built agentically with Claude Code
🚀 Overview
Stop spending weeks on boilerplate. This PySpark project template for Databricks gives you medallion architecture, Python packaging, unit + integration + load tests, CI/CD, DQX data quality, service-principal-based production deploys, and much more — all wired together and ready to ship. Whether you’re starting a new Databricks ETL project or looking for a reference implementation of production-ready PySpark pipelines, fork this and go.
If this saves you time, a star helps others find it. Let’s connect on LinkedIn.
utilize Databricks Lakeflow Jobs to execute a DAG - Yes, you don’t need Airflow to manage your DAGs here!!!. Generate job definitions to run with environment-specific conditions using Databricks SDK.
isolate “dev” environments / catalogs to avoid concurrency issues between developer tests.
separate deploy-time config (environment variables, CI secrets) from runtime config (job parameters overridable from the Databricks UI), keeping jobs flexible without coupling them to the build process.
utilize job tags to track issues, costs, and ownership.
utilize Databricks DQX to enforce data quality rules, such as null checks, uniqueness, thresholds, and schema validation, and filter bad data into quarantine tables.
enforce production guardrails out of the box — identity-locked CI deploys, a health-check task, wheel version pinning, per-task timeouts, schema-drift guards, queued runs, and on-call alerting.
use a Claude ‘project-costs’ skill to track project cloud spend in USD across AWS (Cost Explorer) and Databricks — see an example.
use a Claude ‘sql-diagram’ skill to diagram any SQL query with sqlglot — see an example.
use a Claude ‘data-divergence’ skill to investigate why two datasets that should agree don’t — see an example.
Deep technical detail lives in specs/ (the README stays a landing page):
Architecture — wheel/CLI surface, jobs DAG, job generation, CI/CD, job-level params, deploy-time env vars, logging, production guardrails, folder structure.
Data model — catalog/schema isolation, medallion data flow (diagram), table schemas, product-name freeze semantics, the dashboard, liquid clustering, DQX/quarantine, lineage.
Workflow — the development lifecycle (plan → branch → PR), PR description standard, production-table impact check, the prod rollback playbook, and the unit / integration / load test plan.
Tooling — MCP servers (Databricks, AWS billing/docs, context7), the Databricks CLI, and the bundled skills.
Install and configure the Databricks CLI on your local machine. Check the current version in databricks.yml. Follow the instructions here.
Set up the Python environment and run unit tests on your local machine.
make sync && make unit-test
Initialize the workspace. Create an external location in Databricks and update the storage-root parameter in the Makefile. This step will create the catalogs, schemas, service principal, and the required grants. For more details, see Overview of external locations. Then
run:
make init
Generate a secret for the service principal. In Databricks, go to: Workspace -> Settings -> Identity and access -> Service principals -> Secrets. Generate a new secret for your service principal and update the corresponding profiles in your .databrickscfg file. Your configuration should look similar to this:
Configure CI/CD automation with the service principal ID and secret. Configure GitHub Actions repository secrets: DATABRICKS_HOST, DATABRICKS_CLIENT_ID, DATABRICKS_CLIENT_SECRET, and TEMPLATE_ALERT_EMAILS (comma-separated on-call addresses).
(Optional) You can also execute unit tests from your preferred IDE. Here’s a screenshot from VS Code with Microsoft’s Python extension installed.
评论