dab: add CLI --pipeline/--catalog flags for Databricks wheel execution #222

Closed
opened 2026-03-25 03:23:18 +00:00 by kert · 1 comment
Owner

Problem

The stack run CLI command needs flags for Databricks PythonWheelTask execution: --pipeline <name> --catalog <catalog>.

Design

stack run readmissions --catalog aco_dev

When --catalog is provided, use make_databricks_loader(spark, catalog) instead of the DuckDB loader. Spark session acquired from Databricks runtime via SparkSession.builder.getOrCreate().

Tasks

  • Add --catalog option to cli/run.py
  • When --catalog set: import spark, create make_databricks_loader, call pipeline.run(load)
  • When --catalog not set: existing DuckDB path (unchanged)
  • Graceful error if pyspark not available (not on Databricks)
  • Tests: mock spark, verify loader creation
## Problem The `stack run` CLI command needs flags for Databricks PythonWheelTask execution: `--pipeline <name> --catalog <catalog>`. ## Design ```bash stack run readmissions --catalog aco_dev ``` When `--catalog` is provided, use `make_databricks_loader(spark, catalog)` instead of the DuckDB loader. Spark session acquired from Databricks runtime via `SparkSession.builder.getOrCreate()`. ## Tasks - [ ] Add `--catalog` option to `cli/run.py` - [ ] When `--catalog` set: import spark, create `make_databricks_loader`, call `pipeline.run(load)` - [ ] When `--catalog` not set: existing DuckDB path (unchanged) - [ ] Graceful error if pyspark not available (not on Databricks) - [ ] Tests: mock spark, verify loader creation
kert added this to the P28: DAB Modernization — Python wheel tasks, databricks-bundles, schema cleanup milestone 2026-03-25 03:23:18 +00:00
Author
Owner

Complete.

  • Added --catalog option to stack run (implies target=spark)
  • Added _SparkContext class with make_databricks_loader integration
  • stack run readmissions --catalog aco_dev runs pipeline on Databricks via SparkSession
  • Graceful: pyspark only imported when target=spark

✅ Lint clean.

Complete. - Added `--catalog` option to `stack run` (implies `target=spark`) - Added `_SparkContext` class with `make_databricks_loader` integration - `stack run readmissions --catalog aco_dev` runs pipeline on Databricks via SparkSession - Graceful: pyspark only imported when target=spark ✅ Lint clean.
kert closed this issue 2026-03-25 03:39:34 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: homelab/stack#222