Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export the ipynb to a directory outside of the current workspace, there wasn't any python code prompt at the start to change directory to the previous location of the .ipynb file. #4419

Closed
zhouwangyang opened this issue Jan 18, 2021 · 9 comments · Fixed by #8751
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug interactive-window Impacts interactive window verified Verification succeeded
Milestone

Comments

@zhouwangyang
Copy link

Environment data

Version: 1.53.0-insider (user setup)
Commit: eaa959d34b863dec932077d94daece22504a396b
Date: 2021-01-18T05:13:25.733Z
Electron: 11.2.0
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Windows_NT x64 10.0.17134
anaconda: python 3.8.5(64 bit)
Build of python-insider: 2020.12.414227025
Build of Jupyter-insider: 2021.1.481581316-rc

Expected behaviour

1.Open the file in the browser, should get an initial cell added to change directory back to your workspace directory.
2.Open the file in the editor. There should be python code at the start to change directory to the previous location of the .ipynb file

Actual behaviour

  1. Open the file in the browser, there did not get an initial cell added to change directory back to your workspace directory.
  2. Open the file in the editor. There didn't python code at the start to change directory to the previous location of the .ipynb file

Steps to reproduce:

  1. Run the code manualTestFile.py, and export the .ipynb to a directory outside of the current workspace(not default export path)
  2. Open the file in the browser, you should get an initial cell added to change directory back to your workspace directory
  3. Follow the previous steps for import, but import an ipynb that is located outside of your current workspace
    4.Open the file in the editor. There should be python code at the start to change directory to the previous location of the .ipynb file
@zhouwangyang zhouwangyang added the bug Issue identified by VS Code Team member as probable bug label Jan 18, 2021
@IanMatthewHuff
Copy link
Member

@zhouwangyang Thanks for filing. Confirmed I'm not seeing the directory change on import.

@joyceerhl
Copy link
Contributor

joyceerhl commented Jan 19, 2021

@IanMatthewHuff I was just debugging this. Provided that the python file we're running from is in the current workspace, this is working for me:

Open the file in the browser, there did not get an initial cell added to change directory back to your workspace directory.

Exporting and then opening in editor, I am also seeing this, not sure if this is what we are expecting to see?:

image

@greazer
Copy link
Member

greazer commented Jan 21, 2021

Regression perhaps, but we're unclear as to whether this needs to be fixed at all. We should change the test plan.

@greazer greazer removed the bug Issue identified by VS Code Team member as probable bug label Jun 6, 2021
@DavidKutu DavidKutu added this to the September 2021 milestone Aug 31, 2021
@greazer greazer added interactive-window Impacts interactive window and removed notebook-import-export labels Sep 2, 2021
@greazer
Copy link
Member

greazer commented Sep 2, 2021

@zhouwangyang please reopen and provide any clarification if you're still seeing a problem.

@greazer greazer closed this as completed Sep 2, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 10, 2021
@IanMatthewHuff IanMatthewHuff added the verified Verification succeeded label Sep 30, 2021
@IanMatthewHuff
Copy link
Member

I still repro this. But doesn't seem worthy of Sept consideration.

@IanMatthewHuff IanMatthewHuff removed the verified Verification succeeded label Oct 1, 2021
@DonJayamanne
Copy link
Contributor

@IanMatthewHuff mentioned he could repro, as nothing has been done to fix this, I"m re-opening this issue.

@DonJayamanne DonJayamanne reopened this Oct 27, 2021
@rchiodo rchiodo modified the milestones: October 2021, November 2021 Oct 27, 2021
@greazer greazer added minor-regression bug Issue identified by VS Code Team member as probable bug and removed regression labels Oct 28, 2021
@rchiodo rchiodo removed this from the November 2021 milestone Dec 6, 2021
@rchiodo rchiodo added this to the January 2022 milestone Dec 6, 2021
@amunger amunger self-assigned this Jan 14, 2022
@amunger
Copy link
Contributor

amunger commented Jan 19, 2022

When trying to reproduce this and looking at the code, it seems like all the limitations are by design:
export python script to notebook - only if current file exists on disk
export IW to notebook - no, no backing file
export notebook to python script - only when nbconvert is used as export method
import notebook as python script - only when nbconvert is used as export method

It would be a good idea to clarify the nbconvert limitation in the setting's description.

@amunger
Copy link
Contributor

amunger commented Jan 20, 2022

This feature has a few issues: the path format is broken for Windows, the path is incorrect for importing/exporting notebooks, and it's not implemented in non-nbconvert code-paths.
Looking at telemetry, this is a fairly low-use feature, and since this issue hasn't gotten much attention, we can probably just remove it.

@amunger amunger linked a pull request Jan 20, 2022 that will close this issue
9 tasks
@IanMatthewHuff IanMatthewHuff added the verified Verification succeeded label Jan 28, 2022
@IanMatthewHuff
Copy link
Member

IanMatthewHuff commented Jan 28, 2022

Verified the deprecation:

image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug interactive-window Impacts interactive window verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants