Skip to content

Extract walk_catalog_schemas scaffold in databricks.py - #574

Open
xsh310 wants to merge 3 commits into
skills-picker-ui-packagefrom
skills-picker-walk
Open

Extract walk_catalog_schemas scaffold in databricks.py#574
xsh310 wants to merge 3 commits into
skills-picker-ui-packagefrom
skills-picker-walk

Conversation

@xsh310

@xsh310 xsh310 commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

What changed, and why?

Change: Extract the catalogs → schemas → parallel-per-schema-probe walk out of list_all_mcp_services into a generic walk_catalog_schemas[T](*, deadline, probe, collect, skip_catalogs=…) in databricks.py, and rewrite list_all_mcp_services on top of it. The scaffold owns catalog/schema enumeration, the worker pools, and the wall-clock deadline drain; the caller supplies the probe (list_mcp_services) and a collect that owns accumulation, dedup, progress, and streaming.

Why: Pure refactor (PR B in the ug skill add interactive-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 check and ruff format clean; full uv run pytest green except the two pre-existing e2e failures (test_e2e_user_agent, test_claude_smart_routing_v2) that also fail on main. Added TestWalkCatalogSchemas (skips skip-catalogs + information_schema, probes each user schema, reports progress, returns the right phase-1 reason); the existing TestListAllMcpServices tests stay green unchanged.

This pull request and its description were written by Isaac.

Comment thread src/ucode/databricks.py Outdated
Comment thread src/ucode/databricks.py Outdated
Comment thread src/ucode/databricks.py Outdated
@xsh310
xsh310 marked this pull request as ready for review September 12, 2026 07:13
xsh310 and others added 3 commits September 14, 2026 03:08
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>
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