-
Notifications
You must be signed in to change notification settings - Fork 39
Fix Volume "Open in Databricks" routing to volume URL #1925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -352,6 +352,36 @@ describe(__filename, () => { | |
| assert.strictEqual(item.copyText, "cat"); | ||
| }); | ||
|
|
||
| it("getTreeItem sets volume url with volumes path segment", async () => { | ||
| const stubManager = { | ||
| onDidChangeState: () => ({dispose() {}}), | ||
| databricksWorkspace: { | ||
| host: new URL("https://adb-123.azuredatabricks.net/"), | ||
| }, | ||
| } as unknown as ConnectionManager; | ||
|
|
||
| const provider = new UnityCatalogTreeDataProvider( | ||
| stubManager, | ||
| stubStateStorage | ||
| ); | ||
| disposables.push(provider); | ||
|
|
||
| const volume: UnityCatalogTreeNode = { | ||
| kind: "volume", | ||
| catalogName: "cat", | ||
| schemaName: "sch", | ||
| name: "ev", | ||
| fullName: "cat.sch.ev", | ||
| }; | ||
| const item = provider.getTreeItem(volume) as UnityCatalogTreeItem; | ||
|
|
||
| assert(item.url, "url should be set"); | ||
| assert( | ||
| item.url!.includes("explore/data/volumes/cat/sch/ev"), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit (non-blocking): consider asserting the exact URL with |
||
| `url should contain explore/data/volumes/cat/sch/ev, got: ${item.url}` | ||
| ); | ||
| }); | ||
|
|
||
| it("getTreeItem omits url when no host", async () => { | ||
| const provider = new UnityCatalogTreeDataProvider( | ||
| instance(mockConnectionManager), | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit (non-blocking): this hand-rolls a
stubManagerwith an inline host, while the sibling tests use the sharedmockConnectionManager. 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.