Registry / workflow / dagster-databricks

dagster-databricks

JSON →
library0.29.9pypypi✓ verified 84d ago

The `dagster-databricks` library provides Dagster ops and resources for interacting with Databricks. This includes resources for connecting to Databricks workspaces and ops for running Databricks jobs (notebooks, JARs, Python scripts) or PySpark jobs. As a Dagster library, its version (currently 0.29.0) is released in lockstep with the core `dagster` library (1.13.0), typically on a weekly or bi-weekly cadence.

pip install dagster-databricks
INSTALL
IMPORT
SIG · DAGSTER-DATABRICKS
D
dagster-databricks
workflowpythonv0.29.9
Install
23.0s avg
Import
Disk
658MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.29.9 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.1s · import 0.000s · 656.9MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 45.9s · import 0.000s · 654MB
658MB installed
● package 658MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

DatabricksClient
from dagster_databricks import DatabricksClient
from dagster_databricks import databricks_resource
DatabricksClientResource
from dagster_databricks import DatabricksClientResource
DatabricksJobRunner
from dagster_databricks import DatabricksJobRunner

This quickstart demonstrates how to define a Dagster job that uses `dagster-databricks` to execute a Databricks notebook. It sets up the `databricks_resource` using environment variables for host and token, and uses `databricks_op` to specify the notebook task and cluster configuration. To make this runnable, you must set the `DATABRICKS_HOST` and `DATABRICKS_TOKEN` environment variables and provide a valid `notebook_path` that exists in your Databricks workspace.

import os from dagster import Definitions, job from dagster_databricks import databricks_resource, databricks_op # Configure Databricks resource using environment variables # DATABRICKS_HOST should be 'https://<workspace-url>.cloud.databricks.com' # DATABRICKS_TOKEN is your personal access token databricks_config = { "host": os.environ.get("DATABRICKS_HOST", ""), "token": os.environ.get("DATABRICKS_TOKEN", "") } # Create a configured Databricks resource configured_databricks_resource = databricks_resource.configured(databricks_config) @databricks_op( name="run_example_databricks_notebook", # These parameters map directly to the Databricks Jobs API 'notebook_task' # Replace with your actual notebook path and cluster configuration notebook_task={ "notebook_path": "/Users/your_user@example.com/my_dagster_notebook" }, new_cluster={ "spark_version": "12.2.x-scala2.12", "node_type_id": "i3.xlarge", "num_workers": 1 } ) def run_databricks_notebook(context): """An op to run a Databricks notebook job.""" context.log.info("Databricks notebook job submitted via Dagster.") @job def databricks_example_job(): run_databricks_notebook() # Define a repository using Definitions defs = Definitions( jobs=[databricks_example_job], resources={ "databricks_resource": configured_databricks_resource } ) # To run this example: # 1. Set DATABRICKS_HOST and DATABRICKS_TOKEN environment variables. # 2. Ensure '/Users/your_user@example.com/my_dagster_notebook' exists in your Databricks workspace. # 3. Save this code as a Python file (e.g., `databricks_repo.py`). # 4. Run `dagster dev -f databricks_repo.py` and launch the job from Dagit.
Debug
Known issues
breakingThe `dagster-databricks` library versions are tied to the core `dagster` library versions. For example, `dagster-databricks==0.29.0` is compatible with `dagster==1.13.0`. Upgrading one without the other can lead to import errors or runtime issues due to API changes.
fix
Always upgrade `dagster` and all `dagster-*` libraries simultaneously to their compatible versions as listed in Dagster release notes or dependency manifests.
affects: <0.29.0
gotchaDatabricks authentication requires correctly configuring `DATABRICKS_HOST` and `DATABRICKS_TOKEN` (or equivalent secrets). Incorrect host URLs (e.g., missing `.cloud.databricks.com` suffix) or invalid personal access tokens are common setup errors.
fix
Ensure `DATABRICKS_HOST` is the full workspace URL (e.g., `https://dbc-xxxx.cloud.databricks.com`) and `DATABRICKS_TOKEN` is a valid Databricks personal access token with sufficient permissions (e.g., 'Can Manage' for jobs and clusters).
affects: All
deprecatedThe `databricks_pyspark_step_launcher` was deprecated and replaced by the more flexible `databricks_pyspark_resource`. If you are upgrading from very old `dagster-databricks` versions, your PySpark job definitions will need to be updated.
fix
Migrate from `databricks_pyspark_step_launcher` to using `databricks_pyspark_resource` as the primary way to define PySpark jobs within Dagster. Refer to the official documentation for migration guides if applicable.
affects: <0.14.0
gotchaParameters passed to `databricks_op` (e.g., `notebook_task`, `new_cluster`, `spark_jar_task`, `python_wheel_task`) must conform to the Databricks Jobs API specification. Small discrepancies in key names or structure can lead to job submission failures.
fix
Consult the official Databricks Jobs API documentation for the exact schema required for job tasks and cluster configurations. Ensure your `databricks_op` parameters mirror this structure precisely.
affects: All
Upgrade
Version history
0.29.9latest on PyPI · released Jun 11, 2026
Audit
Dependencies
dagsterrequiredCore Dagster framework is required as this is an integration library.
databricks-sdkrequiredProvides the underlying client for interacting with the Databricks API.
Agent activity
27 hits · last 30 days
node
24
OpenAI (training)
1
Resources
dagster-databricks — pip install dagster-databricks · libregistry