Skip to content

experimental/bundletest: resource handles for all DABs resource types - #6603

Draft
Sankalp-Mittal wants to merge 4 commits into
sankalp-mittal/dabs-testing-frameworkfrom
sankalp-mittal/dabs-resource-handles
Draft

Sankalp-Mittal wants to merge 4 commits into
sankalp-mittal/dabs-testing-frameworkfrom
sankalp-mittal/dabs-resource-handles

Conversation

@Sankalp-Mittal

Copy link
Copy Markdown
Contributor

Summary

Adds a uniform resource-handle layer to the experimental/bundletest/ framework — the test-facing API for asserting on a deployed bundle resource. Stacks on the bundletest base (#6597).

  • ResourceHandle base.config, KeyError-safe .exists(), .permissions(), .grants(), read through the existing get_resource seam. Works unchanged on the local and (future) cloud backends; no new backend primitive.

  • JobHandle / VolumeHandle refactored onto the base (keep .run()/.last_run(), .upload()/.file()), so every handle is uniform.

  • Typed subclasses with special accessors, only where a resource references tables/artifacts/other resources:

    Resource accessor
    pipelines .catalog / .schema / .libraries()
    dashboards, genie_spaces .source_tables() (shared parser)
    quality_monitors .monitored_table()
    vector_search_indexes .source_table() / .endpoint_name
    model_serving_endpoints .served_models()
    apps .command() / .source_code_path

    .source_tables() parses the inline serialized definition (dict or JSON string), matches qualified refs only (drops CTE names/aliases), and raises LocalUnsupported (loud skip) for file_path-only definitions.

  • env.resource(kind, name) reaches every kind generically; typed env.<kind>() factories for the special ones.

Examples

The example bundle declares one instance of every user-authored resource kind (~33), each with an example test — dedicated files for the typed handles, and test_config_resources.py for the pure-config kinds (one labeled test per kind, each asserting a real declared field, no no-ops). The dashboard, genie space, and quality monitor all reference shop.gold.order_summary (the gold table the jobs produce), so they double as cross-resource wiring checks.

Testing

  • cd experimental/bundletest && uv run --extra dev pytest51 passed, 1 skipped (the notebook-job loud skip), offline against the local DuckDB backend.
  • ruff format + ruff check clean.

This pull request and its description were written by Isaac.

Add a uniform resource-handle layer to the bundletest framework. A shared
ResourceHandle base (config, KeyError-safe exists, permissions, grants) is read
through the existing get_resource seam, so handles work unchanged on the local
and cloud backends with no new backend primitive. JobHandle and VolumeHandle are
refactored onto the base, keeping run/last_run and upload/file.

Typed subclasses add resource-specific accessors only where a resource references
tables/artifacts/other resources: pipelines (libraries, catalog, schema),
dashboards and genie_spaces (source_tables, shared serialized-definition parser
that handles inline dict or JSON string, matches qualified refs only, and raises
LocalUnsupported for file_path-only definitions), quality_monitors
(monitored_table), vector_search_indexes (source_table, endpoint_name),
model_serving_endpoints (served_models), and apps (command, source_code_path).
env.resource(kind, name) reaches every kind generically.

The example bundle now declares one instance of every user-authored resource kind
with an example test each: dedicated files for the typed handles, and
test_config_resources.py covering the pure-config kinds (one labeled test per
kind, each asserting a real declared field). The dashboard, genie space, and
quality monitor all reference shop.gold.order_summary so they double as
cross-resource wiring checks.

Co-authored-by: Isaac <no-reply@databricks.com>
@Sankalp-Mittal
Sankalp-Mittal added this pull request to stack #6604 September 10, 2026 13:58
@github-actions

Copy link
Copy Markdown
Contributor

Waiting for approval

Could not determine reviewers from git history.
Round-robin suggestion: @simonfaltum

Eligible reviewers: @andrewnester, @anton-107, @denik, @janniklasrose, @lennartkats-db, @pietern, @rclarey, @renaudhartert-db, @rugpanov, @shreyas-goenka, @simonfaltum

Suggestions based on git history. See OWNERS for ownership rules.

@Sankalp-Mittal
Sankalp-Mittal marked this pull request as draft September 10, 2026 13:58
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 6b503e8

Run: 34610230643

Env 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux 1 275 15 7:54
💚​ aws windows 1 277 13 5:48
💚​ azure linux 1 274 15 7:48
💚​ azure windows 1 276 13 5:20
💚​ gcp linux 1 275 15 8:16
💚​ gcp windows 1 277 13 4:33
Test Name aws linux aws windows azure linux azure windows gcp linux gcp windows
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 4 slowest tests (at least 2 minutes):
duration env testname
4:36 aws windows TestAccept
4:24 azure windows TestAccept
3:24 gcp windows TestAccept
2:06 aws windows TestFilerWorkspaceFilesExtensionsReadDir

Sankalp-Mittal and others added 2 commits September 11, 2026 14:03
- GenieSpaceHandle.source_tables: a genie space's serialized_space uses a
  different schema from a Lakeview dashboard — it declares tables explicitly
  under data_sources.tables[].identifier, not in dataset SQL. The shared
  dashboard parser silently returned [] for genie spaces; give genie its own
  parser and split the shared dict/JSON-string preamble into _load_serialized.
  Update the example genie space to the real schema.
- PipelineHandle.schema: make behavior match the doc — also read the legacy
  DLT `target` field, not just `schema`.
- ResourceHandle.exists: document that it reports declared-in-config, not
  deployed/live workspace state.

Co-authored-by: Isaac <no-reply@databricks.com>
… into resource-handles

# Conflicts:
#	experimental/bundletest/src/bundletest/env.py

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants