Fix Volume "Open in Databricks" routing to volume URL#1925
Conversation
When opening a Volume from the Unity Catalog explorer, the "Open in Databricks" action routed to a table-style URL (/explore/data/<catalog>/<schema>/<name>), which points at a non-existent table rather than the volume. getNodeExploreUrl() special-cased models and functions by prefixing their path segment but had no case for volumes, so volumes fell through to the default (table) path. Add a "volume" case that prefixes the path with "volumes/", producing the correct /explore/data/volumes/<catalog>/<schema>/<name> URL.
|
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
anton-107
left a comment
There was a problem hiding this comment.
Correct, minimal fix. getNodeExploreUrl() was missing a volume case, so volumes fell through to the bare table path; prefixing volumes/ matches the canonical Databricks Explore route and is consistent with the existing models/ and functions/ cases. Volume nodes carry fullName, so the path conversion is safe, and the new test guards the regression.
Approving. Left two non-blocking nits on the test for you to consider.
|
|
||
| assert(item.url, "url should be set"); | ||
| assert( | ||
| item.url!.includes("explore/data/volumes/cat/sch/ev"), |
There was a problem hiding this comment.
Nit (non-blocking): consider asserting the exact URL with assert.strictEqual(item.url, "https://adb-123.azuredatabricks.net/explore/data/volumes/cat/sch/ev") instead of includes(...). A substring check won't catch accidental double-slashes or a wrong prefix/host being concatenated; an exact match locks the route down.
| }); | ||
|
|
||
| it("getTreeItem sets volume url with volumes path segment", async () => { | ||
| const stubManager = { |
There was a problem hiding this comment.
Nit (non-blocking): this hand-rolls a stubManager with an inline host, while the sibling tests use the shared mockConnectionManager. The inline stub is justified here because this test needs a host present, but if the surrounding tests have a helper for a host-configured manager it'd be worth reusing for consistency.
Changes
When opening a Volume from the Unity Catalog explorer, the "Open in Databricks" action routed to a table-style URL
(/explore/data///), which points at a non-existent table rather than the volume.
getNodeExploreUrl() special-cased models and functions by prefixing their path segment but had no case for volumes, so volumes fell through to the default (table) path. Add a "volume" case that prefixes the path with "volumes/", producing the correct
/explore/data/volumes/// URL.
Tests
UnityCatalogTreeDataProvider.test.ts