ML- Fixed the issue with wrong title in predict page (#10467)

* Fixed the issue with wrong title in predict page

* Fixed the type of ml settings

* Increased timeout

* Fixed the bug with R package management and Windows auth

* fixed the tests

* fixed a typo
This commit is contained in:
Leila Lali
2020-05-18 17:12:02 -07:00
committed by GitHub
parent c98eaaf5a1
commit f73d81bc13
9 changed files with 59 additions and 49 deletions

View File

@@ -10,7 +10,9 @@
"azdata": ">=1.13.0" "azdata": ">=1.13.0"
}, },
"activationEvents": [ "activationEvents": [
"onCommand:mls.command.managePackages", "onCommand:ml.command.managePackages",
"onCommand:ml.command.predictModel",
"onCommand:ml.command.importModel",
"onDashboardOpen" "onDashboardOpen"
], ],
"license": "https://raw.githubusercontent.com/Microsoft/azuredatastudio/master/LICENSE.txt", "license": "https://raw.githubusercontent.com/Microsoft/azuredatastudio/master/LICENSE.txt",
@@ -28,66 +30,66 @@
"contributes": { "contributes": {
"configuration": { "configuration": {
"type": "object", "type": "object",
"title": "%mls.configuration.title%", "title": "%ml.configuration.title%",
"properties": { "properties": {
"machineLearning.enablePython": { "machineLearning.enablePython": {
"type": "boolean", "type": "boolean",
"default": "true", "default": true,
"description": "%mls.enablePython.description%" "description": "%ml.enablePython.description%"
}, },
"machineLearning.enableR": { "machineLearning.enableR": {
"type": "boolean", "type": "boolean",
"default": "false", "default": false,
"description": "%mls.enableR.description%" "description": "%ml.enableR.description%"
}, },
"machineLearning.pythonPath": { "machineLearning.pythonPath": {
"type": "string", "type": "string",
"default": "", "default": "",
"description": "%mls.pythonPath.description%" "description": "%ml.pythonPath.description%"
}, },
"machineLearning.rPath": { "machineLearning.rPath": {
"type": "string", "type": "string",
"default": "", "default": "",
"description": "%mls.rPath.description%" "description": "%ml.rPath.description%"
} }
} }
}, },
"commands": [ "commands": [
{ {
"command": "mls.command.managePackages", "command": "ml.command.managePackages",
"title": "%mls.command.managePackages%", "title": "%ml.command.managePackages%",
"icon": { "icon": {
"light": "./images/installPackages.svg", "light": "./images/installPackages.svg",
"dark": "./images/installPackages.svg" "dark": "./images/installPackages.svg"
} }
}, },
{ {
"command": "mls.command.predictModel", "command": "ml.command.predictModel",
"title": "%mls.command.predictModel%", "title": "%ml.command.predictModel%",
"icon": { "icon": {
"light": "./images/makePredictions.svg", "light": "./images/makePredictions.svg",
"dark": "./images/makePredictions.svg" "dark": "./images/makePredictions.svg"
} }
}, },
{ {
"command": "mls.command.manageModels", "command": "ml.command.manageModels",
"title": "%mls.command.manageModels%" "title": "%ml.command.manageModels%"
}, },
{ {
"command": "mls.command.importModel", "command": "ml.command.importModel",
"title": "%mls.command.importModel%", "title": "%ml.command.importModel%",
"icon": { "icon": {
"light": "./images/registerModel.svg", "light": "./images/registerModel.svg",
"dark": "./images/registerModel.svg" "dark": "./images/registerModel.svg"
} }
}, },
{ {
"command": "mls.command.dependencies", "command": "ml.command.dependencies",
"title": "%mls.command.dependencies%" "title": "%ml.command.dependencies%"
}, },
{ {
"command": "mls.command.enableExternalScript", "command": "ml.command.enableExternalScript",
"title": "%mls.command.enableExternalScript%" "title": "%ml.command.enableExternalScript%"
} }
], ],
"dashboard.tabs": [ "dashboard.tabs": [
@@ -109,7 +111,7 @@
"col": 0, "col": 0,
"widget": { "widget": {
"tasks-widget": [ "tasks-widget": [
"mls.command.managePackages" "ml.command.managePackages"
] ]
} }
}, },

View File

@@ -5,16 +5,16 @@
"title.documents": "Documents", "title.documents": "Documents",
"title.configurations": "Configurations", "title.configurations": "Configurations",
"title.endpoints": "Endpoints", "title.endpoints": "Endpoints",
"mls.command.managePackages": "Manage packages in database", "ml.command.managePackages": "Manage packages in database",
"mls.command.manageLanguages": "Manage external languages", "ml.command.manageLanguages": "Manage external languages",
"mls.command.predictModel": "Make prediction", "ml.command.predictModel": "Make prediction",
"mls.command.manageModels": "Manage models", "ml.command.manageModels": "Manage models",
"mls.command.importModel": "Import model", "ml.command.importModel": "Import model",
"mls.configuration.title": "Machine Learning Configurations", "ml.configuration.title": "Machine Learning Configurations",
"mls.pythonPath.description": "Local path to a preexisting Python installation used by Machine Learning.", "ml.pythonPath.description": "Local path to a preexisting Python installation used by Machine Learning.",
"mls.enablePython.description": "Enable Python package management in database.", "ml.enablePython.description": "Enable Python package management in database.",
"mls.enableR.description": "Enable R package management in database.", "ml.enableR.description": "Enable R package management in database.",
"mls.rPath.description": "Local path to a preexisting R installation used by Machine Learning.", "ml.rPath.description": "Local path to a preexisting R installation used by Machine Learning.",
"mls.command.dependencies": "Install Machine Learning Dependencies", "ml.command.dependencies": "Install Machine Learning Dependencies",
"mls.command.enableExternalScript": "Enable External script" "ml.command.enableExternalScript": "Enable External script"
} }

View File

@@ -14,8 +14,8 @@ export const pythonLanguageName = 'Python';
export const rLanguageName = 'R'; export const rLanguageName = 'R';
export const rLPackagedFolderName = 'r_packages'; export const rLPackagedFolderName = 'r_packages';
export const mlEnableMlsCommand = 'mls.command.enableMls'; export const mlEnableMlsCommand = 'ml.command.enableMls';
export const mlDisableMlsCommand = 'mls.command.disableMls'; export const mlDisableMlsCommand = 'ml.command.disableMls';
export const extensionOutputChannel = 'Machine Learning'; export const extensionOutputChannel = 'Machine Learning';
export const notebookExtensionName = 'Microsoft.notebook'; export const notebookExtensionName = 'Microsoft.notebook';
export const azureSubscriptionsCommand = 'azure.accounts.getSubscriptions'; export const azureSubscriptionsCommand = 'azure.accounts.getSubscriptions';
@@ -24,13 +24,13 @@ export const signInToAzureCommand = 'azure.resource.signin';
// Tasks, commands // Tasks, commands
// //
export const mlManageLanguagesCommand = 'mls.command.manageLanguages'; export const mlManageLanguagesCommand = 'ml.command.manageLanguages';
export const mlsPredictModelCommand = 'mls.command.predictModel'; export const mlsPredictModelCommand = 'ml.command.predictModel';
export const mlManageModelsCommand = 'mls.command.manageModels'; export const mlManageModelsCommand = 'ml.command.manageModels';
export const mlImportModelCommand = 'mls.command.importModel'; export const mlImportModelCommand = 'ml.command.importModel';
export const mlManagePackagesCommand = 'mls.command.managePackages'; export const mlManagePackagesCommand = 'ml.command.managePackages';
export const mlsDependenciesCommand = 'mls.command.dependencies'; export const mlsDependenciesCommand = 'ml.command.dependencies';
export const mlsEnableExternalScriptCommand = 'mls.command.enableExternalScript'; export const mlsEnableExternalScriptCommand = 'ml.command.enableExternalScript';
export const notebookCommandNew = 'notebook.command.new'; export const notebookCommandNew = 'notebook.command.new';
// Configurations // Configurations
@@ -104,6 +104,7 @@ export const extLangInstallTabTitle = localize('extLang.installTabTitle', "Insta
export const extLangLanguageCreatedDate = localize('extLang.languageCreatedDate', "Installed"); export const extLangLanguageCreatedDate = localize('extLang.languageCreatedDate', "Installed");
export const extLangLanguagePlatform = localize('extLang.languagePlatform', "Platform"); export const extLangLanguagePlatform = localize('extLang.languagePlatform', "Platform");
export const deleteTitle = localize('extLang.delete', "Delete"); export const deleteTitle = localize('extLang.delete', "Delete");
export const editTitle = localize('editTitle', "Edit");
export const extLangInstallButtonText = localize('extLang.installButtonText', "Install"); export const extLangInstallButtonText = localize('extLang.installButtonText', "Install");
export const extLangCancelButtonText = localize('extLang.CancelButtonText', "Cancel"); export const extLangCancelButtonText = localize('extLang.CancelButtonText', "Cancel");
export const extLangDoneButtonText = localize('extLang.DoneButtonText', "Close"); export const extLangDoneButtonText = localize('extLang.DoneButtonText', "Close");
@@ -129,7 +130,7 @@ export const modelsListEmptyMessage = localize('models.modelsListEmptyMessage',
export const modelsListEmptyDescription = localize('models.modelsListEmptyDescription', "Use import wizard to add models to this table"); export const modelsListEmptyDescription = localize('models.modelsListEmptyDescription', "Use import wizard to add models to this table");
export const databaseName = localize('databaseName', "Models database"); export const databaseName = localize('databaseName', "Models database");
export const databaseToStoreInfo = localize('databaseToStoreInfo', "Select a database to store the new model."); export const databaseToStoreInfo = localize('databaseToStoreInfo', "Select a database to store the new model.");
export const tableToStoreInfo = localize('tableToStoreInfo', "Select an existing table that conforms the model schema or create a new one to store the new model."); export const tableToStoreInfo = localize('tableToStoreInfo', "Select an existing table that conforms the model schema or create a new one to store the imported model.");
export const tableName = localize('tableName', "Models table"); export const tableName = localize('tableName', "Models table");
export const modelTableInfo = localize('modelTableInfo', "Select a model table to view the list of existing / imported models."); export const modelTableInfo = localize('modelTableInfo', "Select a model table to view the list of existing / imported models.");
export const modelDatabaseInfo = localize('modelDatabaseInfo', "Select a database where existing / imported models are stored."); export const modelDatabaseInfo = localize('modelDatabaseInfo', "Select a database where existing / imported models are stored.");

View File

@@ -6,7 +6,7 @@
import * as vscode from 'vscode'; import * as vscode from 'vscode';
import * as childProcess from 'child_process'; import * as childProcess from 'child_process';
const ExecScriptsTimeoutInSeconds = 600000; const ExecScriptsTimeoutInSeconds = 1800000;
export class ProcessService { export class ProcessService {
public timeout = ExecScriptsTimeoutInSeconds; public timeout = ExecScriptsTimeoutInSeconds;

View File

@@ -69,7 +69,8 @@ export class SqlRPackageManageProvider extends SqlPackageManageProviderBase impl
if (connection) { if (connection) {
let database = databaseName ? `, database="${databaseName}"` : ''; let database = databaseName ? `, database="${databaseName}"` : '';
let connectionParts = `server="${connection.serverName}", uid="${connection.userName}", pwd="${credentials[azdata.ConnectionOptionSpecialType.password]}"${database}`; const auth = connection.userName ? `, uid="${connection.userName}", pwd="${credentials[azdata.ConnectionOptionSpecialType.password]}"` : '';
let connectionParts = `server="${connection.serverName}"${auth}${database}`;
let rCommandScript = scriptMode === ScriptMode.Install ? 'sql_install.packages' : 'sql_remove.packages'; let rCommandScript = scriptMode === ScriptMode.Install ? 'sql_install.packages' : 'sql_remove.packages';
let scripts: string[] = [ let scripts: string[] = [

View File

@@ -100,7 +100,8 @@ describe('SQL R Package Manager', () => {
let connection = new azdata.connection.ConnectionProfile(); let connection = new azdata.connection.ConnectionProfile();
connection.serverName = 'serverName'; connection.serverName = 'serverName';
connection.databaseName = 'databaseName'; connection.databaseName = 'databaseName';
let credentials = { [azdata.ConnectionOptionSpecialType.password]: 'password' }; connection.userName = 'user';
let credentials = { [azdata.ConnectionOptionSpecialType.password]: 'password', [azdata.ConnectionOptionSpecialType.userName]: 'user' };
testContext.apiWrapper.setup(x => x.getCurrentConnection()).returns(() => { return Promise.resolve(connection); }); testContext.apiWrapper.setup(x => x.getCurrentConnection()).returns(() => { return Promise.resolve(connection); });
testContext.apiWrapper.setup(x => x.getCredentials(TypeMoq.It.isAny())).returns(() => { return Promise.resolve(credentials); }); testContext.apiWrapper.setup(x => x.getCredentials(TypeMoq.It.isAny())).returns(() => { return Promise.resolve(credentials); });
testContext.processService.setup(x => x.execScripts(TypeMoq.It.isAny(), TypeMoq.It.isAny(), TypeMoq.It.isAny(), TypeMoq.It.isAny())).returns((path, scripts: string[]) => { testContext.processService.setup(x => x.execScripts(TypeMoq.It.isAny(), TypeMoq.It.isAny(), TypeMoq.It.isAny(), TypeMoq.It.isAny())).returns((path, scripts: string[]) => {
@@ -139,7 +140,11 @@ describe('SQL R Package Manager', () => {
let connection = new azdata.connection.ConnectionProfile(); let connection = new azdata.connection.ConnectionProfile();
connection.serverName = 'serverName'; connection.serverName = 'serverName';
connection.databaseName = 'databaseName'; connection.databaseName = 'databaseName';
let credentials = { [azdata.ConnectionOptionSpecialType.password]: 'password' }; connection.userName = 'user';
let credentials = {
[azdata.ConnectionOptionSpecialType.password]: 'password',
[azdata.ConnectionOptionSpecialType.userName]: 'user'
};
testContext.apiWrapper.setup(x => x.getCurrentConnection()).returns(() => { return Promise.resolve(connection); }); testContext.apiWrapper.setup(x => x.getCurrentConnection()).returns(() => { return Promise.resolve(connection); });
testContext.apiWrapper.setup(x => x.getCredentials(TypeMoq.It.isAny())).returns(() => { return Promise.resolve(credentials); }); testContext.apiWrapper.setup(x => x.getCredentials(TypeMoq.It.isAny())).returns(() => { return Promise.resolve(credentials); });
testContext.processService.setup(x => x.execScripts(TypeMoq.It.isAny(), TypeMoq.It.isAny(), TypeMoq.It.isAny(), TypeMoq.It.isAny())).returns((path, scripts: string[]) => { testContext.processService.setup(x => x.execScripts(TypeMoq.It.isAny(), TypeMoq.It.isAny(), TypeMoq.It.isAny(), TypeMoq.It.isAny())).returns((path, scripts: string[]) => {

View File

@@ -138,7 +138,7 @@ export class LanguagesTable extends LanguageViewBase {
let editLanguageButton = this._modelBuilder.button().withProperties({ let editLanguageButton = this._modelBuilder.button().withProperties({
label: '', label: '',
title: constants.deleteTitle, title: constants.editTitle,
iconPath: { iconPath: {
dark: this.asAbsolutePath('images/dark/edit_inverse.svg'), dark: this.asAbsolutePath('images/dark/edit_inverse.svg'),
light: this.asAbsolutePath('images/light/edit.svg') light: this.asAbsolutePath('images/light/edit.svg')

View File

@@ -287,7 +287,7 @@ export class CurrentModelsTable extends ModelViewBase implements IDataComponent<
editButton = this._modelBuilder.button().withProperties({ editButton = this._modelBuilder.button().withProperties({
label: '', label: '',
title: constants.deleteTitle, title: constants.editTitle,
iconPath: { iconPath: {
dark: this.asAbsolutePath('images/dark/edit_inverse.svg'), dark: this.asAbsolutePath('images/dark/edit_inverse.svg'),
light: this.asAbsolutePath('images/light/edit.svg') light: this.asAbsolutePath('images/light/edit.svg')

View File

@@ -40,6 +40,7 @@ export class PredictWizard extends ModelViewBase {
* Opens a dialog to manage packages used by notebooks. * Opens a dialog to manage packages used by notebooks.
*/ */
public async open(): Promise<void> { public async open(): Promise<void> {
this.modelSourceType = ModelSourceType.RegisteredModels;
this.modelSourcePage = new ModelSourcePage(this._apiWrapper, this, [ModelSourceType.RegisteredModels, ModelSourceType.Local, ModelSourceType.Azure]); this.modelSourcePage = new ModelSourcePage(this._apiWrapper, this, [ModelSourceType.RegisteredModels, ModelSourceType.Local, ModelSourceType.Azure]);
this.columnsSelectionPage = new ColumnsSelectionPage(this._apiWrapper, this); this.columnsSelectionPage = new ColumnsSelectionPage(this._apiWrapper, this);
this.modelBrowsePage = new ModelBrowsePage(this._apiWrapper, this, false); this.modelBrowsePage = new ModelBrowsePage(this._apiWrapper, this, false);