You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Remove custom entry from Jupyter Notebook & Cell Metadata #205637
This is an unnecessary layer
Everywhere in code we need to look at custom, when there's no such thing in Jupyter (specification) metdata.
This is a carry over from the old VS Code notebook Notebook format.
All metadata had to be stored under custom and this was never migrated when custom in core was removed.
This shows up in SCM view as well
I.e. when using the diff view, the custom node is displayed, and this is wrong, as there's no such thing in the spec.
Removing this will:
Improve SCM
Make it easier for extensions to access the metadata
Ensure the API lines up with the Jupyter specification
changed the title [-]Remote `custom` entry from Jupyter Notebook Cell Metadata[/-][+]Remove `custom` entry from Jupyter Notebook Cell Metadata[/+]on Feb 20, 2024
David Anthoff (@davidanthoff)
From what I can tell, the only place where the Notebook or Cell metadata is accessed, is in the notebookFeature.ts file.
My plan is to submit a PR that would make a change to support both the old custom and the new format.
This way, it would be backwards compatible if and when we move away from the custom property.
Should be easy enough to create a single function that returns the metadata and use that everywhere.
Looking at the code in Polyglot Notebooks (Interactive)
I can see it is used in a large number of places notebookControllers.ts, metadataUtilities.ts, notebookSerializers.ts, etc.
I think the best and safest way to make such a change in your repo would be to have an if condition that conditionally uses custom based on the version of VS Code being used.
From what I can tell, tehre are a number of files that would be effected, hence the change would not be as simple/straightforward, happy to discuss offline.
changed the title [-]Remove `custom` entry from Jupyter Notebook Cell Metadata[/-][+]Remove `custom` entry from Jupyter Notebook & Cell Metadata[/+]on Mar 18, 2024
Activity
DonJayamanne commentedon Feb 20, 2024
Peng Lyu (@rebornix) /cc
We will need to coordinate this with partner teams that read/write ipynb notebooks
[-]Remote `custom` entry from Jupyter Notebook Cell Metadata[/-][+]Remove `custom` entry from Jupyter Notebook Cell Metadata[/+]DonJayamanne commentedon Mar 17, 2024
David Anthoff (@davidanthoff)
From what I can tell, the only place where the Notebook or Cell metadata is accessed, is in the
notebookFeature.tsfile.My plan is to submit a PR that would make a change to support both the old
customand the new format.This way, it would be backwards compatible if and when we move away from the
customproperty.Should be easy enough to create a single function that returns the metadata and use that everywhere.
How does that sound?
DonJayamanne commentedon Mar 18, 2024
Diego Colombo (@colombod)
Looking at the code in Polyglot Notebooks (Interactive)
I can see it is used in a large number of places
notebookControllers.ts,metadataUtilities.ts,notebookSerializers.ts, etc.I think the best and safest way to make such a change in your repo would be to have an
ifcondition that conditionally usescustombased on the version of VS Code being used.From what I can tell, tehre are a number of files that would be effected, hence the change would not be as simple/straightforward, happy to discuss offline.
[-]Remove `custom` entry from Jupyter Notebook Cell Metadata[/-][+]Remove `custom` entry from Jupyter Notebook & Cell Metadata[/+]davidanthoff commentedon Mar 18, 2024
Don Jayamanne (@DonJayamanne) that definitely works!
DonJayamanne commentedon Apr 22, 2024
Closing as done.