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

Copy and paste of cells causes "non-unique cell id" error. #167951

Closed
1 of 2 tasks
liganega opened this issue Dec 2, 2022 · 5 comments
Closed
1 of 2 tasks

Copy and paste of cells causes "non-unique cell id" error. #167951

liganega opened this issue Dec 2, 2022 · 5 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug *duplicate Issue identified as a duplicate of another issue(s) notebook-clipboard notebook-ipynb

Comments

@liganega
Copy link

liganega commented Dec 2, 2022

Applies To

  • Notebooks (.ipynb files)
  • Interactive Window and/or Cell Scripts (.py files with #%% markers)

What happened?

As the title suggests, when I copy and paste a cell, the generated cell has the same id as the original one.

This only happens with jupyter extension for VS Code while the original jupyter notebook server (installed by Anaconda) automatically changes the id of a copied cell.

So it's a reasonable conclusion that the problem should definitely have something to do with the jupyter extension, not with the original jupyter notebook server.

VS Code Version

1.73.1

Jupyter Extension Version

v2022.9.1303220346

Jupyter logs

No response

Coding Language and Runtime Version

No response

Language Extension Version (if applicable)

No response

Anaconda Version (if applicable)

Anaconda3-2022.05

Running Jupyter locally or remotely?

Local

@liganega liganega added the bug Issue identified by VS Code Team member as probable bug label Dec 2, 2022
@amunger amunger transferred this issue from microsoft/vscode-jupyter Dec 2, 2022
@amunger
Copy link
Contributor

amunger commented Dec 2, 2022

Vs code doesn't create Cell IDs for cells that it creates, but the jupyter notebook web UI will, and it looks like that gets duplicated because we just copy whatever is in the metadata.

@amunger amunger assigned roblourens and unassigned amunger Dec 2, 2022
@amunger
Copy link
Contributor

amunger commented Dec 2, 2022

@liganega - I assume that you are seeing this error in the jupyter UI? (not within vs code)

@liganega
Copy link
Author

liganega commented Dec 2, 2022

First, VS Code DOES create cell IDs.

Although the error was found by another tool (jupyter book), the creation of Cell IDs was checked by Vim with the source code( with metadata) after copy-and-paste (C-V combination) in VS Code.

The same thing was checked with the original jupyter notebook, but, as I said before, new IDs are created, also checked by Vim with the source code.

As @amunger said, the C-V combination duplicates everything in the metadata including Cell ID while jupyter notebook changes it.

@liganega
Copy link
Author

liganega commented Dec 2, 2022

One more thing.

About duplicated IDs, VS Code does not complain while jupyter notebook does.

@roblourens roblourens assigned rebornix and unassigned roblourens Dec 5, 2022
@roblourens roblourens removed the bug Issue identified by VS Code Team member as probable bug label Dec 5, 2022
@rebornix rebornix added bug Issue identified by VS Code Team member as probable bug notebook-ipynb notebook-clipboard labels Dec 5, 2022
@rebornix
Copy link
Member

/duplicate of #103881, we should not copy metadata it seems.

@VSCodeTriageBot VSCodeTriageBot added the *duplicate Issue identified as a duplicate of another issue(s) label Dec 14, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jan 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug *duplicate Issue identified as a duplicate of another issue(s) notebook-clipboard notebook-ipynb
Projects
None yet
Development

No branches or pull requests

5 participants