mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
* Fix connection dialog for Spark and issue when switching from Kusto to Spark * Address comments
This commit is contained in:
@@ -457,8 +457,15 @@ export class AttachToDropdown extends SelectBox {
|
|||||||
try {
|
try {
|
||||||
// Get all providers to show all available connections in connection dialog
|
// Get all providers to show all available connections in connection dialog
|
||||||
let providers = this.model.getApplicableConnectionProviderIds(this.model.clientSession.kernel.name);
|
let providers = this.model.getApplicableConnectionProviderIds(this.model.clientSession.kernel.name);
|
||||||
for (let alias of this.model.kernelAliases) {
|
// Spark kernels are unable to get providers from above, therefore ensure that we get the
|
||||||
providers = providers.concat(this.model.getApplicableConnectionProviderIds(alias));
|
// correct providers for the selected kernel and load the proper connections for the connection dialog
|
||||||
|
// Example Scenario: Spark Kernels should only have MSSQL connections in connection dialog
|
||||||
|
if (!this.model.kernelAliases.includes(this.model.selectedKernelDisplayName) && this.model.clientSession.kernel.name !== 'SQL') {
|
||||||
|
providers = providers.concat(this.model.getApplicableConnectionProviderIds(this.model.selectedKernelDisplayName));
|
||||||
|
} else {
|
||||||
|
for (let alias of this.model.kernelAliases) {
|
||||||
|
providers = providers.concat(this.model.getApplicableConnectionProviderIds(alias));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
let connection = await this._connectionDialogService.openDialogAndWait(this._connectionManagementService,
|
let connection = await this._connectionDialogService.openDialogAndWait(this._connectionManagementService,
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -658,8 +658,11 @@ export class NotebookModel extends Disposable implements INotebookModel {
|
|||||||
let providerFeatures = this._capabilitiesService.getCapabilities(profile.providerName);
|
let providerFeatures = this._capabilitiesService.getCapabilities(profile.providerName);
|
||||||
if (connectionProviderIds?.length) {
|
if (connectionProviderIds?.length) {
|
||||||
this._currentKernelAlias = providerFeatures?.connection.notebookKernelAlias;
|
this._currentKernelAlias = providerFeatures?.connection.notebookKernelAlias;
|
||||||
// Adds Kernel Alias and Connection Provider to Map if new Notebook connection contains notebookKernelAlias
|
// Switching from Kusto to another kernel should set the currentKernelAlias to undefined
|
||||||
if (this._currentKernelAlias) {
|
if (this._selectedKernelDisplayName !== this._currentKernelAlias && this._selectedKernelDisplayName) {
|
||||||
|
this._currentKernelAlias = undefined;
|
||||||
|
} else {
|
||||||
|
// Adds Kernel Alias and Connection Provider to Map if new Notebook connection contains notebookKernelAlias
|
||||||
this._kernelDisplayNameToConnectionProviderIds.set(this._currentKernelAlias, [profile.providerName]);
|
this._kernelDisplayNameToConnectionProviderIds.set(this._currentKernelAlias, [profile.providerName]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user