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

Notebook metadata being initialised in wrong place #2176

Closed
chrisjsewell opened this issue Mar 12, 2020 · 5 comments
Closed

Notebook metadata being initialised in wrong place #2176

chrisjsewell opened this issue Mar 12, 2020 · 5 comments
Assignees

Comments

@chrisjsewell
Copy link

Bug: Notebook Editor, Interactive Window, Editor cells

First noted in jupyter/jupyter-sphinx#108

Creating a new notebook with:

Name: Python
Id: ms-python.python
Description: Linting, Debugging (multi-threaded, remote), Intellisense, Jupyter Notebooks, code formatting, refactoring, unit tests, snippets, and more.
Version: 2020.2.64397
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-python.python 

leads to:

{
 "nbformat": 4,
 "nbformat_minor": 2,
 "metadata": {
  "language_info": {
    "name": "python",
    "codemirror_mode": {
      "name": "ipython",
      "version": 3
   }
  },
  "orig_nbformat": 2,
  "file_extension": ".py",
  "mimetype": "text/x-python",
  "name": "python",
  "npconvert_exporter": "python",
  "pygments_lexer": "ipython3",
  "version": 3
 },
 "cells": []
}

This is incorrect, because all the metadata should actually be under the language_info key:

{
 "nbformat": 4,
 "nbformat_minor": 2,
 "metadata": {
  "language_info": {
    "name": "python",
    "codemirror_mode": {
      "name": "ipython",
      "version": 3,
    },
    "orig_nbformat": 2,
    "file_extension": ".py",
    "mimetype": "text/x-python",
    "name": "python",
    "npconvert_exporter": "python",
    "pygments_lexer": "ipython3",
    "version": 3
  },
 },
 "cells": []
}
@DonJayamanne
Copy link
Contributor

Thanks for filing this issue. I can confirm this is a bug at our end.

@chrisjsewell
Copy link
Author

chrisjsewell commented Mar 13, 2020

In a related matter, it would also be ideal if the notebook JSON was saved with sorted top-level keys, i.e. ['cells', 'metadata', 'nbformat', 'nbformat_minor']. This is to reduce git diffs, if for example I also open and save the notebook via jupyter notebook or jupyter lab (which save it in this manner).

@DonJayamanne
Copy link
Contributor

In a related matter, it would also be ideal if the notebook JSON was save

Please could you file a separate issue for that.Thanks.
& I agree it will help with diffing..

@DavidKutu DavidKutu self-assigned this Apr 7, 2020
@rchiodo
Copy link
Contributor

rchiodo commented Apr 10, 2020

Validated. Should be fixed in the next release

@rchiodo rchiodo closed this as completed Apr 10, 2020
@chrisjsewell
Copy link
Author

thanks 👍

@lock lock bot locked as resolved and limited conversation to collaborators Apr 18, 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

4 participants