Extract walk_catalog_schemas scaffold in databricks.py - #574
Merged
Merged
Conversation
xsh310
added this pull request to stack #576
September 11, 2026 21:08
xsh310
commented
Sep 11, 2026
xsh310
commented
Sep 11, 2026
xsh310
commented
Sep 11, 2026
xsh310
marked this pull request as ready for review
September 12, 2026 07:13
xsh310
force-pushed
the
skills-picker-walk
branch
from
September 12, 2026 07:16
d96da01 to
5d4e8cb
Compare
xsh310
force-pushed
the
skills-picker-walk
branch
from
September 14, 2026 03:08
5d4e8cb to
0e30a65
Compare
xsh310
force-pushed
the
skills-picker-walk
branch
from
September 14, 2026 20:09
0e30a65 to
45e3518
Compare
sunishsheth2009
approved these changes
Sep 14, 2026
xsh310
force-pushed
the
skills-picker-walk
branch
from
September 14, 2026 22:32
45e3518 to
1e76edc
Compare
xsh310
force-pushed
the
skills-picker-walk
branch
from
September 14, 2026 23:20
1e76edc to
9ad2118
Compare
xsh310
force-pushed
the
skills-picker-walk
branch
from
September 15, 2026 00:53
9ad2118 to
51dfe7b
Compare
xsh310
force-pushed
the
skills-picker-walk
branch
from
September 15, 2026 01:17
51dfe7b to
2feecb9
Compare
xsh310
force-pushed
the
skills-picker-walk
branch
from
September 15, 2026 01:41
2feecb9 to
4ecece6
Compare
xsh310
force-pushed
the
skills-picker-walk
branch
from
September 15, 2026 03:30
4ecece6 to
d7066a2
Compare
xsh310
force-pushed
the
skills-picker-walk
branch
from
September 15, 2026 03:40
d7066a2 to
7033962
Compare
xsh310
force-pushed
the
skills-picker-walk
branch
2 times, most recently
from
September 15, 2026 14:43
8dfc114 to
de4ed86
Compare
xsh310
force-pushed
the
skills-picker-walk
branch
from
September 15, 2026 18:17
de4ed86 to
f064113
Compare
xsh310
force-pushed
the
skills-picker-walk
branch
from
September 15, 2026 19:56
f064113 to
7136a84
Compare
xsh310
force-pushed
the
skills-picker-walk
branch
from
September 15, 2026 21:19
7136a84 to
45e3518
Compare
Factor the catalogs -> schemas -> parallel-per-schema-probe walk out of list_all_mcp_services into a generic walk_catalog_schemas(probe, collect), and rewrite list_all_mcp_services on top of it. The scaffold owns catalog/schema enumeration, worker pools, and the wall-clock deadline drain; the caller owns the probe, accumulation, dedup, progress, and streaming. No behavior change; the upcoming skills walk (download picker) becomes the second caller. Co-authored-by: Isaac <no-reply@databricks.com>
Rewrite the docstring around the high-level behavior and spell out the probe/collect callable shapes; revert the incidental schema_name -> name rename. Co-authored-by: Isaac <no-reply@databricks.com>
Rename _UC_FUNCTION_PROBE_WORKERS -> _SCHEMA_PROBE_WORKERS (a generic per-schema concurrency cap, not UC-function-specific) and expose it as the max_workers param, mirroring skip_catalogs. Co-authored-by: Isaac <no-reply@databricks.com>
xsh310
force-pushed
the
skills-picker-walk
branch
from
September 16, 2026 00:51
45e3518 to
9afcebc
Compare
xsh310
added a commit
that referenced
this pull request
Sep 16, 2026
## What PR C of the `ug skill add` interactive-picker stack. It reshapes `skills_download.py` so the download mechanics become one reusable core, and adds the (still unwired) functions the picker will call in PR D. **No behavior changes on any existing path.** Design doc: `ug_skill_add_download_interactive_picker_design.md` (PR table, row C). ## Changes - **`SkillRef` carries its full location.** New `catalog`/`schema` fields plus an `fqn` property, parsed once from the API `name` in `_skill_ref`, so a ref is self-contained and can be downloaded on its own. - **Extract `_download_refs(refs, roots) -> (written, total)`**, the shared core: collision dedup, overwrite prompt, parallel fetch, write. `should_download_skill` and `_reject_bundle_name_collisions` now read the source off the ref (`ref.fqn`) instead of an explicit `location` arg, which produces byte-identical messages and lets the core serve a flat, cross-schema set. - **`_fetch_bundles` keys results by FQN** (a securable name is unique only within its schema) and takes its progress-bar label from the caller. - **Rename `download_skills` to `download_skills_from_schema_locations`**, now calling `_download_refs` per location and keeping the exact per-location `Downloaded k/n from <location>` summary. - **Add `get_skill(fqn)`** (GetSkill at `/2.1/unity-catalog/skills/<fqn>`, reusing `_skill_ref`; NOT_FOUND to `None`) and **`download_selected_skills(fqns, path)`** (one `_download_refs` pass over the flat selection). Both are dead code until PR D wires the picker. ## Deviations from the design doc - `download_managed_skills_on_launch` is a **second caller of `_fetch_bundles`** the doc did not mention; it is updated to the new keying (behavior-preserving). - The doc lists `should_download_skill` / `_reject_bundle_name_collisions` as reused unchanged, but making the core location-agnostic means they read the source off the ref. The emitted messages are identical (`<catalog>.<schema>.<securable>` equals `ref.fqn`). ## Testing `uv run ruff check .`, `ruff format --check src tests`, and `uv run pytest` all pass (the 2 pre-existing e2e failures in `test_e2e_user_agent` and `test_claude_smart_routing_v2` are unrelated and also fail on the base branch). New unit tests cover `_download_refs` (including cross-schema dedup), `get_skill` (NOT_FOUND to `None`, unfinalized to `None`), and `download_selected_skills`. Stacked on #574 (`skills-picker-walk`). This pull request and its description were written by Isaac. --------- Co-authored-by: Isaac <no-reply@databricks.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed, and why?
Change: Extract the catalogs → schemas → parallel-per-schema-probe walk out of
list_all_mcp_servicesinto a genericwalk_catalog_schemas[T](*, deadline, probe, collect, skip_catalogs=…)indatabricks.py, and rewritelist_all_mcp_serviceson top of it. The scaffold owns catalog/schema enumeration, the worker pools, and the wall-clock deadline drain; the caller supplies theprobe(list_mcp_services) and acollectthat owns accumulation, dedup, progress, and streaming.Why: Pure refactor (PR B in the
ug skill addinteractive-picker stack). Extracting the walk lets PR D's skills discovery reuse it as a second caller.list_all_mcp_services's signature and every return value are unchanged.Note: the design doc's PR B also mentioned rewriting
list_uc_functions_catalog_schemas, but that function does not exist in this repo — there is a single walk today, so the scaffold has one caller now and the skills walk becomes the second in PR D.How do you know it works?
Testing:
ruff checkandruff formatclean; fulluv run pytestgreen except the two pre-existing e2e failures (test_e2e_user_agent,test_claude_smart_routing_v2) that also fail onmain. AddedTestWalkCatalogSchemas(skips skip-catalogs +information_schema, probes each user schema, reports progress, returns the right phase-1 reason); the existingTestListAllMcpServicestests stay green unchanged.This pull request and its description were written by Isaac.