microsoft / vscode-jupyter

VS Code Jupyter extension
https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter
MIT License
1.27k stars 280 forks source link

New notebook editor messing with old notebooks #7508

Closed ubalklen closed 2 years ago

ubalklen commented 2 years ago

Environment data

Before the new editor, I had a notebook with a cell like this:

results_path = "results.json"

with open(results_path) as json_file:
    loaded_results = json.load(json_file)

loaded_results["results"]["Airports"].keys()

After opening it in the new editor, saving and reopen in the old editor (because the new one has some bugs), I got this:

results_path = "results.json"

with open(results_path) as json_file:
    loaded_results = json.load(json_le)fi

loaded_results["results"]["Airports"].keyse)

The new editor totally screwed up the last two lines. And this is only a sample. Every single cell in my notebook is now broken (and since I'm not using version control, I lost hours of work...)

IanMatthewHuff commented 2 years ago

@ubalklen How were you opening up the files in the old editor? Were you using an old version of the extension to do that? That behavior that you are seeing is more likely caused by the reopen on the old editor versus the new editor. Moving forward the new editor is going to be the only option so hopefully we can help resolve those issues that are blocking you (please file issues on the things that are blocking your workflow).

ubalklen commented 2 years ago

They were already open. I also noticed that I had been able to open notebooks in the old editor by double-clicking on them, but I cant' reproduce that anymore. The only way to open the notebooks in the new editor was by right-clicking and selecting "Open in notebook editor".

IanMatthewHuff commented 2 years ago

Sounds like that might have been with an older version of the extension. Moving forward the old editor won't be an available option anymore.

greazer commented 2 years ago

@ubalklen, I agree, this was a bad bug and we're sorry that it occurred. Note that we did have similar, but extremely hard to repro, bugs reported just using the old editor over the past year or so, so I'm not convinced that the issue related to the combination of the new and old editor. Since the old editor has been completely deprecated and removed and the new editor implements persistence differently, it's unlikely this will happen again.