Set notebook directory as current directory for pip installs from workspace fs#961
Merged
kartikgupta-db merged 5 commits intomainfrom Dec 5, 2023
Merged
Set notebook directory as current directory for pip installs from workspace fs#961kartikgupta-db merged 5 commits intomainfrom
kartikgupta-db merged 5 commits intomainfrom
Conversation
…vscode into workflow-preamble
ilia-db
approved these changes
Dec 5, 2023
Merged
ilia-db
added a commit
that referenced
this pull request
Dec 5, 2023
## packages/databricks-vscode ## <small>1.2.4 (2023-12-05)</small> * Send environment type (tests, prod) in telemetry events (#944) ([1ce3ef0](1ce3ef0)), closes [#944](#944) * Set notebook directory as current directory for pip installs from workspace fs (#961) ([eec87b8](eec87b8)), closes [#961](#961) [#958](#958) * Show error for a corrupted config file (#955) ([8b5a944](8b5a944)), closes [#955](#955) * Update Databricks CLI to v0.210.1 (#957) ([c9864e1](c9864e1)), closes [#957](#957) ## packages/databricks-vscode-types ## <small>1.2.4 (2023-12-05)</small> --------- Co-authored-by: releasebot <[email protected]> Co-authored-by: Ilia Babanov <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When users use a relative path to install a notebook scoped library with pip (eg
%pip install ../../foo) it can fail since cwd for shell commands can be an ephemeral directory in DBRs < 14.0.For other shell commands, our preamble handles the cwd, but pip commands are moved to the beginning of the notebook, since they can lead to a kernel restart and hence loss of preamble. This means, they can't access the features of the full preamble and need an explicit
os.chdirto set the correct path.Changes
os.chdir(notebook_dir)before each%pip install.Tests
Fixes #958