Skip to content

Use a Lakebase table to store oversized run configs - #1547

Merged
mwojtyczka merged 19 commits into
mainfrom
dqx-studio-run-config-table
Sep 29, 2026
Merged

mwojtyczka merged 19 commits into
mainfrom
dqx-studio-run-config-table

Conversation

@ghanse

@ghanse ghanse commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Changes

This PR modifies the handling of oversized run configs to use a Lakebase table instead of the wheel file volume.

Linked issues

Resolves #1558

Tests

  • manually tested
  • added unit tests
  • added integration tests
  • added end-to-end tests
  • added performance tests

Documentation and Demos

  • added/updated demos
  • added/updated docs
  • added/updated agent skills

@codecov

codecov Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.94%. Comparing base (066f09a) to head (487db79).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1547   +/-   ##
=======================================
  Coverage   92.94%   92.94%           
=======================================
  Files         142      142           
  Lines       14002    14002           
  Branches      151      151           
=======================================
  Hits        13014    13014           
  Misses        919      919           
  Partials       69       69           
Flag Coverage Δ
anomaly 51.22% <ø> (ø)
anomaly-serverless 51.22% <ø> (+31.66%) ⬆️
integration 44.18% <ø> (-3.03%) ⬇️
integration-serverless 49.30% <ø> (+0.45%) ⬆️
mcp 80.34% <ø> (ø)
unit 66.25% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

✅ 28/28 passed, 1 flaky, 4h8m21s total

Flaky tests:

  • 🤪 test_run_dqx_row_anomaly_detection_demo (45m9.763s)

Running from acceptance #6048

@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

✅ 1/1 passed, 26m51s total

Running from mcp #797

@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

✅ 195/195 passed, 1 skipped, 6h3m55s total

Running from anomaly #2162

@mwojtyczka mwojtyczka added the DQX App Feature/Bug related to the DQX App label Sep 23, 2026
@mwojtyczka mwojtyczka changed the title [DQX Studio] Use a Delta table to store oversized run configs Use a Delta table to store oversized run configs Sep 23, 2026
Comment thread app/src/databricks_labs_dqx_app/backend/migrations/__init__.py Outdated
Comment thread app/tasks/src/dqx_task_runner/runner.py Outdated
Comment thread app/tasks/src/dqx_task_runner/runner.py
Comment thread app/src/databricks_labs_dqx_app/backend/run_config_store.py Outdated
Comment thread app/src/databricks_labs_dqx_app/backend/run_config_store.py
Comment thread app/scripts/seed_demo.py
…d; thread Lakebase coords in demo seeder

Oversized run configs are staged to the dq_run_configs Lakebase table and read
back by the task runner over Postgres. Two gaps remained on the Lakebase-disabled
(Delta OLTP fallback) and demo-seeding paths:

- prepare_config_json staged unconditionally, so in the documented
  lakebase_endpoint="-" (Delta OLTP) mode an oversized config was written to a
  table the runner could never read over Postgres, surfacing as a confusing
  connection error. Fail fast with an actionable RunConfigStagingUnavailableError
  when the OLTP dialect is not "postgres".
- The demo-seeding CLI constructed JobService without any lakebase_* coordinates,
  so a staged config could not be read back. Thread the resolved coordinates from
  the live OLTP executor, mirroring get_job_service.

Covered by a new unit test for the fail-fast path; existing staging tests now pin
the mock OLTP executor to the postgres dialect.

Co-authored-by: Isaac <no-reply@databricks.com>

@mwojtyczka mwojtyczka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

mwojtyczka and others added 2 commits September 29, 2026 09:45
…s dialect

The oversized-config fail-fast guard added in e3fa811 only stages when the OLTP
dialect is "postgres". test_submit_deletes_staged_row_when_submission_fails used
an autospec mock whose dialect was not "postgres", so staging was skipped and the
delete-on-failure path was never exercised. Pin the mock's dialect to "postgres"
so the test reflects the Lakebase-enabled staging scenario it is asserting.

Co-authored-by: Isaac <no-reply@databricks.com>
Addresses four review findings on the oversized run-config path:

- startup: a malformed DQX_TASK_RUNNER_POSTGRES_ROLE no longer aborts the app.
  validate_object_id now logs and skips the optional grant instead of letting
  ValueError escape the lifespan (a malformed role still never reaches DDL).
- monitored_tables run route: RunConfigStagingError (Lakebase unreachable /
  dq_run_configs missing) now maps to HTTP 503 instead of 400; caller/config
  errors (too large, Lakebase disabled) stay 400. Subclass catch precedes base.
- startup grant loop: the failure warning now names the specific failing
  statement so a later opaque runner permission error is traceable.
- get_job_service: resolve lakebase schema/database from the live OLTP executor
  (with resource fallback), consistent with the other coordinates, so the app
  stages the row to exactly the schema the runner is told to read from.

Tests updated/added: malformed-role now skips (not raises); grant failure names
the statement and continues; run route maps 503 vs 400; get_job_service threads
schema/database from the executor.

Co-authored-by: Isaac <no-reply@databricks.com>
Comment thread app/src/databricks_labs_dqx_app/backend/startup.py
Comment thread app/src/databricks_labs_dqx_app/backend/startup.py
Comment thread app/src/databricks_labs_dqx_app/backend/dependencies.py
The root `make fmt` job uses black as the Python formatter; my earlier change
was formatted with the app venv's newer ruff, which wraps multi-line asserts
differently and churned two pre-existing asserts into a style black reverts.
Reformat with black so the file is a fixed point of the CI fmt check again.

Co-authored-by: Isaac <no-reply@databricks.com>
@ghanse ghanse mentioned this pull request Oct 1, 2026
2 of 8 tasks

This branch was successfully deployed

1 active deployment
tool — 487db792 Deployed Sep 29, 2026 by mwojtyczka via integration_serverless #6048
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approved to Merge When PR is reviewed and approved. To be merged once all tests pass DQX App Feature/Bug related to the DQX App

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Use Lakebase for oversized DQX Studio job runner configuration

2 participants