Skip to content

Adding job runs support to PyDABs - #6515

Open
hejcman-enverus wants to merge 5 commits into
databricks:mainfrom
hejcman-enverus:pydabs-job-runs-support
Open

Adding job runs support to PyDABs#6515
hejcman-enverus wants to merge 5 commits into
databricks:mainfrom
hejcman-enverus:pydabs-job-runs-support

Conversation

@hejcman-enverus

@hejcman-enverus hejcman-enverus commented Sep 3, 2026

Copy link
Copy Markdown

Changes

  • Add PyDABs models for the job_runs resource.
  • Add Resources.job_runs and Resources.add_job_run(), including resource merging through load_resources.
  • Add job_run_mutator support and register job_run as a PyDABs resource type.
  • Add unit and acceptance coverage for defining a job and a referencing job run in Python.
  • Add a changelog fragment for the new PyDABs support.

Example usage

from databricks.bundles.core import Resources, Variable
from databricks.bundles.job_runs import JobRun, JobRunLifecycle, JobRunTrigger
from databricks.bundles.jobs import Job


def load_resources() -> Resources:
    resources = Resources()

    resources.add_job("my_job", Job(name="My Job"))

    resources.add_job_run(
        "my_run",
        JobRun(
            job_id=Variable(path="resources.jobs.my_job.id", type=int),
            lifecycle=JobRunLifecycle(
                triggers=[JobRunTrigger(on_bundle_deploy=True)]
            ),
        ),
    )

    return resources

Why

The Databricks CLI supports job_runs as a bundle resource, but PyDABs had no equivalent model or resource registration. This prevented Python bundle definitions from creating job runs or referencing jobs defined in the same load_resources function.

This change brings job_runs in line with existing PyDABs resources such as jobs, schemas, and volumes. Job dependencies are expressed through normal bundle references, for example resources.jobs.my_job.id.

Tests

  • Ran the complete PyDABs unit test suite: 245 tests passed.
  • Ran Pyright: zero errors.
  • Added and ran the bundle/python/job-runs-support acceptance test.
  • Verified the acceptance test with both DMS configurations under the direct deployment engine.
  • Ran repository quick checks successfully.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Approval status: pending

/acceptance/bundle/ - needs approval

7 files changed
Suggested: @denik
Also eligible: @andrewnester, @janniklasrose, @shreyas-goenka, @anton-107, @lennartkats-db, @pietern

General files (require maintainer)

17 files changed
Based on git history:

  • @denik -- recent work in .nextchanges/bundles/, python/codegen/codegen_tests/

Any maintainer (@andrewnester, @anton-107, @denik, @pietern, @shreyas-goenka, @simonfaltum, @renaudhartert-db, @janniklasrose, @lennartkats-db, @rugpanov, @rclarey) can approve all areas.
See OWNERS for ownership rules.

@hejcman-enverus
hejcman-enverus marked this pull request as draft September 3, 2026 12:12
@hejcman-enverus
hejcman-enverus marked this pull request as ready for review September 3, 2026 12:52
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

An authorized user can trigger integration tests manually by following the instructions below:

Trigger:
go/deco-tests-run/cli

Inputs:

  • PR number: 6515
  • Commit SHA: b7c2e807c3a4d862b531f6d88e537c987c5ed2b9

Checks will be approved automatically on success.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant