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

Validation Issue when opening .ipynb file in other .ipynb editors (Jupyter Notebook) #2063

Closed
shac12 opened this issue Mar 30, 2020 · 7 comments
Assignees

Comments

@shac12
Copy link

shac12 commented Mar 30, 2020

Environment data

  • VS Code version: 1.43.2
  • Extension version (available under the Extensions sidebar): 2020.3.69010
  • OS and version: Windows 10 Home 10.0.18363 Build 18363
  • Python version (& distribution if applicable, e.g. Anaconda): 3.7.6 anaconda
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
  • Relevant/affected Python packages and their versions: XXX
  • Relevant/affected Python-related VS Code extensions and their versions: XXX
  • Jedi or Language Server? (i.e. what is "python.jediEnabled" set to; more info How to update the language server to the latest stable version vscode-python#3977): Disabled
  • Value of the python.languageServer setting: Microsoft

Expected behaviour

The file is expetected to open normally in Jupyter Notebook

Actual behaviour

Upon opening the .ipynb file this validation error occurs.

Notebook validation failed: Additional properties are not allowed ('outputs', 'execution_count' were unexpected):
{
"cell_type": "markdown",
"metadata": {},
"source": "# Comp9417 - Homework 2\n## Question 2",
"execution_count": null,
"outputs": []
}

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

  1. Use Vscode to open a .ipynb file.
  2. Work as per usual.
  3. Open file that was being edited in vscode in jupyter notebook in google chrome.

Produces this validation error.

Notebook validation failed: Additional properties are not allowed ('outputs', 'execution_count' were unexpected):
{
"cell_type": "markdown",
"metadata": {},
"source": "# Comp9417 - Homework 2\n## Question 2",
"execution_count": null,
"outputs": []
}

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

XXX

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging)

XXX
@sirily
Copy link

sirily commented Apr 2, 2020

I have almost the same issue after working as usual in VSCode and then opening .ipynb in Jupyter Notebook:

Notebook validation failed: ['outputPrepend', 'outputPrepend', ..., 'outputPrepend'] has non-unique elements:
[
 "outputPrepend",
 "outputPrepend",
...,
"outputPrepend"]

VSCode ver.: 1.43.2
Extension ver.: 2020.3.71113

@greazer
Copy link
Member

greazer commented Apr 2, 2020

Sounds like a possible regression of microsoft/vscode-python#8772.

@DavidKutu DavidKutu self-assigned this Apr 8, 2020
@DavidKutu
Copy link

DavidKutu commented Apr 9, 2020

Hi @shac12, could you give us some specifics steps to get to a markdown cell with outputs and execution time? I've been trying it executing a code cell a bunch of times, changing it to markdown and saving. But I can't get it to give me a bad notebook.

We'd appreciate anything you can find.

Edit: Also, could you try it with our insider's build? Maybe that one doesn't have the issue.

@shac12 shac12 closed this as completed Apr 12, 2020
@shac12 shac12 reopened this Apr 12, 2020
@shac12
Copy link
Author

shac12 commented Apr 12, 2020

Hi @DavidKutu

I will try and replicate the scenario as best as i can but it can be inconsistent. Im not really sure how to do this step " to get to a markdown cell with outputs and execution time?". I'm not sure that, that is the issue. It seems that when I start a ipynb file in vscode and then try and open it in jupyter notebook, jupyter notebook complains that this is not a valid file. I can send you a test file if you would like ? I believe that there is some issue with the actual save functionality of vscode but I can only speculate.

How would I get into the insiders build ?

cheers for following up on this.

@DavidKutu
Copy link

DavidKutu commented Apr 13, 2020

The bit about

" to get to a markdown cell with outputs and execution time?"

is what jupyter notebook is saying on the validation error.

That happens when a markdown cell has either the 'ouputs' or the 'execution_time' properties.
It was an issue we had that happened when you:

  1. Create a code cell
  2. Execute it
  3. Change it to a markdown cell
  4. Save the notebook

Or:

  1. Open a notebook with a code cell with an output
  2. Change it to a markdown cell
  3. Save the notebook

That's what I've been trying to get the validation error to show up, but haven't been able to. Any steps that you can give us to reproduce the validation error would help a lot. (For example, open a new notebook, type this in the first cell, save it, etc...).

To use the insiders build you can download VS code insiders: https://code.visualstudio.com/insiders/

Its another VS code, but it updates to the latest build, even before release. If you get the python extension on VS code insiders, you will be using our latest build that might have your issue resolved.

@DonJayamanne
Copy link
Contributor

Moving to validate as we have fixed this (AFAIK)

@IanMatthewHuff
Copy link
Member

Validated. I'm not able to create the markdown cells with execution_count or output anymore.

@lock lock bot locked as resolved and limited conversation to collaborators May 6, 2020
@microsoft microsoft unlocked this conversation Nov 13, 2020
@DonJayamanne DonJayamanne transferred this issue from microsoft/vscode-python Nov 13, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants