Machine Learning Services Settings (#8968)

* Added two config to Machine Learning Services extension to enable and disable python and r
This commit is contained in:
Leila Lali
2020-02-03 09:25:36 -08:00
committed by GitHub
parent c6689700f6
commit 56a6f70c0d
11 changed files with 68 additions and 8 deletions

View File

@@ -132,6 +132,9 @@ export class PackageManager {
}
private async installRequiredRPackages(startBackgroundOperation: azdata.BackgroundOperation): Promise<void> {
if (!this._config.rEnabled) {
return;
}
if (!this._rExecutable) {
throw new Error(constants.rConfigError);
}
@@ -143,6 +146,9 @@ export class PackageManager {
* Installs required python packages
*/
private async installRequiredPythonPackages(): Promise<void> {
if (!this._config.pythonEnabled) {
return;
}
if (!this._pythonExecutable) {
throw new Error(constants.pythonConfigError);
}

View File

@@ -93,6 +93,9 @@ export class SqlPythonPackageManageProvider extends SqlPackageManageProviderBase
* Returns true if the provider can be used
*/
async canUseProvider(): Promise<boolean> {
if (!this._config.pythonEnabled) {
return false;
}
let connection = await this.getCurrentConnection();
if (connection && await this._queryRunner.isPythonInstalled(connection)) {
return true;

View File

@@ -92,6 +92,9 @@ export class SqlRPackageManageProvider extends SqlPackageManageProviderBase impl
* Returns true if the provider can be used
*/
async canUseProvider(): Promise<boolean> {
if (!this._config.rEnabled) {
return false;
}
let connection = await this.getCurrentConnection();
if (connection && await this._queryRunner.isRInstalled(connection)) {
return true;