From 9c842e7548893ddd67d4db8f54d69b4c83402ede Mon Sep 17 00:00:00 2001 From: Monica Gupta Date: Mon, 30 Mar 2020 10:43:26 -0700 Subject: [PATCH] Kql magic updates (#9753) * Inludes package upgrade and silent env * Make user param changes * Address comments Co-authored-by: Monica Gupta --- .../notebook/src/jupyter/jupyterServerInstallation.ts | 8 +++----- extensions/notebook/src/jupyter/jupyterSessionManager.ts | 3 +++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/extensions/notebook/src/jupyter/jupyterServerInstallation.ts b/extensions/notebook/src/jupyter/jupyterServerInstallation.ts index 2a78483ef5..f85bafc6fa 100644 --- a/extensions/notebook/src/jupyter/jupyterServerInstallation.ts +++ b/extensions/notebook/src/jupyter/jupyterServerInstallation.ts @@ -89,7 +89,7 @@ export class JupyterServerInstallation implements IJupyterServerInstallation { version: '0.12.9' }, { name: 'Kqlmagic', - version: '0.1.108' + version: '0.1.109' } ]; @@ -588,9 +588,7 @@ export class JupyterServerInstallation implements IJupyterServerInstallation { let versionSpecifier = useMinVersion ? '>=' : '=='; let packagesStr = packages.map(pkg => `"${pkg.name}${versionSpecifier}${pkg.version}"`).join(' '); - // Force reinstall in case some dependencies are split across multiple locations - let cmdOptions = this._usingExistingPython ? '--user --force-reinstall' : '--force-reinstall'; - let cmd = `"${this.pythonExecutable}" -m pip install ${cmdOptions} ${packagesStr} --extra-index-url https://prose-python-packages.azurewebsites.net`; + let cmd = `"${this.pythonExecutable}" -m pip install --user ${packagesStr} --extra-index-url https://prose-python-packages.azurewebsites.net`; return this.executeStreamedCommand(cmd); } @@ -630,7 +628,7 @@ export class JupyterServerInstallation implements IJupyterServerInstallation { let versionSpecifier = useMinVersion ? '>=' : '=='; let packagesStr = packages.map(pkg => `"${pkg.name}${versionSpecifier}${pkg.version}"`).join(' '); let condaExe = this.getCondaExePath(); - let cmd = `"${condaExe}" install -y --force-reinstall ${packagesStr}`; + let cmd = `"${condaExe}" install -y ${packagesStr}`; return this.executeStreamedCommand(cmd); } diff --git a/extensions/notebook/src/jupyter/jupyterSessionManager.ts b/extensions/notebook/src/jupyter/jupyterSessionManager.ts index 2ffb70cfc2..3cdd97e9da 100644 --- a/extensions/notebook/src/jupyter/jupyterSessionManager.ts +++ b/extensions/notebook/src/jupyter/jupyterSessionManager.ts @@ -351,6 +351,9 @@ export class JupyterSession implements nb.ISession { } } + // Enable silent mode for perf improvement of reload command. + allCode += `%set_env KQLMAGIC_LOAD_MODE=silent${EOL}`; + // Add and register Kqlmagic to the python kernel allCode += `%reload_ext Kqlmagic`;