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

"Clear All Output" is greyed out and doesn't clear execution count unless output is available #235784

Open
1 of 2 tasks
MarcBarlett opened this issue Feb 28, 2024 · 10 comments
Open
1 of 2 tasks
Assignees
Labels
feature-request Request for new features or functionality notebook-commands

Comments

@MarcBarlett
Copy link

Applies To

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

What happened?

Create a new cell in an *.ipynb.
run an import statement, the execution count increments.
expected that this execution statement could be cleared with the "Clear All Outputs" button it cannot.
image

add a print statement to the cell and run.
The "Clear All Outputs" is now available and can be used to clear the execution count as well as outputs.
image

"Clear All Outputs" should be available to clear execution counts even if none of the cells have printed outputs.

VS Code Version

1.86.2

Jupyter Extension Version

2024.1.1

Jupyter logs

No response

Coding Language and Runtime Version

Python v 3.10.10

Language Extension Version (if applicable)

No response

Anaconda Version (if applicable)

No response

Running Jupyter locally or remotely?

None

@MarcBarlett MarcBarlett added the bug Issue identified by VS Code Team member as probable bug label Feb 28, 2024
@DonJayamanne DonJayamanne self-assigned this Feb 28, 2024
@ScottBoyce
Copy link

Same effect for me with

VS Code Version
1.89.1

Jupyter Extension Version
2024.4.0

Coding Language and Runtime Version
Python v 3.12.2

@DonJayamanne DonJayamanne added feature-request Request for new features or functionality and removed bug Issue identified by VS Code Team member as probable bug labels May 15, 2024
@drush0

This comment has been minimized.

@ejfdickinson

This comment has been minimized.

@bernard-123lb
Copy link

bernard-123lb commented Oct 8, 2024

Source Control

Just in case this was not immediately obvious to someone, "execution_count": 1 is problematic for source control. We want to nullify/clear all outputs before committing to reduce merge conflicts. So I have to manually nullify those before committing directly in the json file. I noticed that commits from users of the original Jupyter IDE seems to always have nullified execution_count as expected.

@chrispy-snps
Copy link

We are also running into this in v1.94.2. And as @bernard-123lb says, the merge conflict aspect is particularly problematic.

@DonJayamanne
Copy link
Contributor

DonJayamanne commented Oct 21, 2024

@ejfdickinson @drush0 I've re-opened the issue microsoft/vscode-jupyter#16052
& will be fixing that.

@DonJayamanne
Copy link
Contributor

TEMPORARY SOLUTION/WORK AROUND

Please use the command Notebook: Clear Cell Outputs
I understand this doesn't fix the problem with the icon not being enabled, hence temporar work around

@DonJayamanne DonJayamanne added notebook-output api-proposal under-discussion Issue is under discussion for relevance, priority, approach labels Dec 10, 2024
@DonJayamanne DonJayamanne transferred this issue from microsoft/vscode-jupyter Dec 10, 2024
@DonJayamanne DonJayamanne added notebook-commands and removed under-discussion Issue is under discussion for relevance, priority, approach api-proposal notebook-output labels Dec 10, 2024
@gsverhoeven

This comment has been minimized.

@DonJayamanne
Copy link
Contributor

@gsverhoeven Thanks for reporting this, I've created an issue for what you've identified here #237299

@kelvinou01
Copy link

Thanks for investigating a workaround @gsverhoeven, and @DonJayamanne for working on the fix.

This bug makes working with version control a pain, so I'm looking forward to this being resolved!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality notebook-commands
Projects
None yet
Development

No branches or pull requests

9 participants