Skip to content

Add data_quality_monitors bundle resource (direct engine) - #7094

Draft
kevinlian2it wants to merge 4 commits into
mainfrom
kevin-lian/data-quality-monitors
Draft

kevinlian2it wants to merge 4 commits into
mainfrom
kevin-lian/data-quality-monitors

Conversation

@kevinlian2it

Copy link
Copy Markdown

Changes

Adds a data_quality_monitors bundle resource for the data-quality/v1 Monitor API (anomaly detection on schemas, data profiling on tables). Direct engine only. The legacy quality_monitors resource is unchanged; deprecating it is a separate follow-up.

  • bundle/config/resources/data_quality_monitor.go embeds dataquality.Monitor. The ID is <object_type>,<object_id>, the same as the Terraform import ID for databricks_data_quality_monitor.
  • bundle/direct/dresources/data_quality_monitor.go: CRUD on w.DataQuality. Update sends the static mask anomaly_detection_config,data_profiling_config, the same mask the Terraform provider uses.
  • configs/data_quality_monitors.yml: object_type and object_id are ID fields. data_profiling_config.assets_dir recreates on change, because the update API ignores it. skip_builtin_dashboard and warehouse_id ignore remote changes, because they are create-time inputs. Output-only fields come from the generated config.
  • Matches quality_monitors: run_as is rejected (the API has none), and presets that pause triggers drop data_profiling_config.schedule (its pause_status is read-only). The monitor has no name, so there is no name prefix. It has no permissions and no workspace URL, because object_id is a UUID.
  • Adds registration, a testserver fake, regenerated schema/validation/direct configs/PyDABs, and the acceptance tests listed below.

Why

Data quality monitoring is moving to GA on the data-quality/v1 API, and quality_monitors only covers the legacy table-monitor API. This resource lets bundles manage v1 monitors, including schema-level anomaly detection, which the legacy resource can't express.

Notes for reviewers:

  • No lookup variables: the API has no get-by-display-name (API-160), and ListMonitor is unimplemented server-side, so lookup variables aren't supported for this resource.
  • PyDABs and empty objects: PyDABs drops empty objects (omitempty), so snapshot: {} is lost when a monitor is defined in Python. quality_monitors has the same pre-existing limitation; it's visible in the data_quality_monitors-support golden.

Tests

  • Unit: all non-acceptance packages pass. New fixtures in all_test.go, state_load_test.go, resources_test.go, and the mutator tests. apply_target_mode_test asserts the dev-mode schedule drop.
  • Acceptance (local testserver):
    • resources/data_quality_monitors/basic: schema monitor that references ${resources.schemas.x.schema_id}. Covers create, in-place update, no drift, recreate on an identity change, and destroy.
    • data_profiling: table monitor. Covers output-only fields not drifting, in-place schedule update, and assets_dir recreate.
    • remote-delete: an out-of-band delete is detected.
    • lifecycle: cloud-capable.
    • deployment/bind/data_quality_monitor: bind and unbind, and a malformed ID is rejected.
    • Invariant config: all 9 variants pass. It's excluded from the migrate suites (direct-only) and from cloud runs, where the lifecycle test covers it.
    • python/data_quality_monitors-support.
  • golangci-lint run ./... reports 0 issues. tidy, whitespace, deadcode, codeowners and lockfile checks pass, and all generators are idempotent. 505 PyDABs tests pass.
  • Not verified yet:
    • The full acceptance suite and the PyDABs golden. Both need jq ≥ 1.7, and only jq 1.6 was available locally, so the PyDABs golden was produced with an equivalent jq 1.6 filter ({experimental: {python: …}, resources: …} instead of pick(…)).
    • The lifecycle test against a real workspace. In particular, whether GET echoes skip_builtin_dashboard and warehouse_id.

This pull request and its description were written by Isaac.

kevinlian2it and others added 2 commits October 15, 2026 20:56
Adds the data-quality/v1 Monitor API as a direct-engine bundle resource,
alongside the legacy quality_monitors resource it supersedes.

Co-authored-by: Isaac <no-reply@databricks.com>
@github-actions github-actions Bot added DABs DABs related issues PyDABs labels Oct 16, 2026
@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 9d0f286

Run: 38942982174

Env ❌​FAIL 🔄​flaky ✅​pass 🙈​skip Time
❌​ aws linux-2core-8gb 3 280 405 6:31
❌​ aws-windows-latest-4core-16gb 3 282 403 6:44
❌​ azure linux-2core-8gb 3 2 277 405 6:28
❌​ azure-windows-latest-4core-16gb 3 4 277 403 5:56
❌​ gcp linux-2core-8gb 3 2 278 405 6:33
❌​ gcp-windows-latest-4core-16gb 3 282 403 5:17
11 interesting tests: 8 flaky, 3 FAIL
Test Name aws linux-2core-8gb aws-windows-latest-4core-16gb azure linux-2core-8gb azure-windows-latest-4core-16gb gcp linux-2core-8gb gcp-windows-latest-4core-16gb
❌​ TestAccept ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/data_quality_monitors/lifecycle ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/data_quality_monitors/lifecycle/DMS=true ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
🔄​ TestFsCpDirToDirWithOverwriteFlag ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p
🔄​ TestFsCpDirToDirWithOverwriteFlag/uc-volumes_to_dbfs ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p
🔄​ TestFsCpFileToDir ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p
🔄​ TestFsCpFileToDir/dbfs_to_uc-volumes ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p
🔄​ TestFsCpFileToFileWithOverwriteFlag ✅​p ✅​p 🔄​f ✅​p ✅​p ✅​p
🔄​ TestFsCpFileToFileWithOverwriteFlag/local_to_uc-volumes ✅​p ✅​p 🔄​f ✅​p ✅​p ✅​p
🔄​ TestFsCpSourceIsDirectoryButTargetIsFile ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p
🔄​ TestFsCpSourceIsDirectoryButTargetIsFile/dbfs_to_uc-volumes ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p

This branch has not been deployed

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

Labels

DABs DABs related issues PyDABs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants