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

Saving a notebook modifies (e.g. removes) metadata #2919

Closed
shahinrostami opened this issue Oct 13, 2019 · 4 comments
Closed

Saving a notebook modifies (e.g. removes) metadata #2919

shahinrostami opened this issue Oct 13, 2019 · 4 comments
Assignees

Comments

@shahinrostami
Copy link

Bug: Saving an ipynb modifies (e.g. removes) metadata.

Steps to cause the bug to occur

  1. Save the following to a notebook (.ipynb) file:
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Write your post here."
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "env": {},
   "interrupt_mode": "signal",
   "language": "python",
   "metadata": {},
   "name": "python3"
  },
  "nikola": {
   "category": "",
   "date": "2019-10-13 11:38:58 UTC+01:00",
   "description": "",
   "link": "",
   "slug": "test",
   "tags": "",
   "title": "Test",
   "type": "text"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
  1. Open it in VSCode, make a change (e.g. add the word "test" to the markdown) and save it.

  2. View the source for the .ipynb and you will see the metadata is gone:

Screenshot 2019-10-13 at 11 42 35

Actual & Expected behavior

The expected behaviour, ideally, is to leave the metadata alone. The site-generator I use throws an error and exits when it doesn't get the expected metadata.

Your Jupyter and/or Python environment

Please provide as much info as you readily know

  • Jupyter server running: Local
  • VS Code version: 1.40.0-Insider
  • Python and/or Anaconda version: Anaconda 2019.7, Python 3.7.3 64-bit
  • OS: Mac
  • Virtual environment: conda
@rchiodo
Copy link
Contributor

rchiodo commented Oct 14, 2019

We should not be removing the metadata. The cause of this is we don't save the metadata internally, so of course we remove it.

@rchiodo rchiodo self-assigned this Oct 14, 2019
@shahinrostami
Copy link
Author

We should not be removing the metadata. The cause of this is we don't save the metadata internally, so of course we remove it.

I see - thank you for confirming that. How difficult do you think a fix will be?

@rchiodo
Copy link
Contributor

rchiodo commented Oct 14, 2019

Not very hard. I'm actually working on this right now.

@IanMatthewHuff IanMatthewHuff self-assigned this Oct 21, 2019
@IanMatthewHuff
Copy link
Member

Validated with a local test file. Metadata is no longer removed.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 28, 2019
@microsoft microsoft unlocked this conversation Nov 14, 2020
@DonJayamanne DonJayamanne transferred this issue from microsoft/vscode-python Nov 14, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 7, 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

3 participants