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

Update Display Data disappears when display and display.update are in the same cell #1710

Closed
hsm opened this issue Sep 1, 2020 · 10 comments
Closed
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@hsm
Copy link

hsm commented Sep 1, 2020

Bug: Notebook Editor, Interactive Window, Editor cells

This bug seems to be related to microsoft/vscode-python#10874 . Note that the consequence of this bug is that VSCode cannot be used effectively with the current version of the FastAI library.

Steps to cause the bug to occur

# %%
from time import sleep

from IPython.display import Markdown

# %%
dh = display(display_id=True)

# %%
dh.update(Markdown('`Display Update Fun 1`'))
sleep(3)
dh.update(Markdown('`This update remains`'))
# %%
dh = display(Markdown('`Display Update Fun 2`'), display_id=True)
dh.update(Markdown('`This update is supposed to remain`'))
sleep(3)

Actual behavior

Direct kernel connection
Python version:
3.7.3 (default, Apr 24 2020, 18:51:23) \n[Clang 11.0.3 (clang-1103.0.32.62)]
[1] from time import sleep...
[2] dh = display(display_id=True)
`This update remains`
[3] dh.update(Markdown('`Display Update Fun 1`'))...
[4] dh = display(Markdown('`Display Update Fun 2`'), display_id=True)...
`Display Update Fun 2`

Expected behavior

Direct kernel connection
Python version:
3.7.3 (default, Apr 24 2020, 18:51:23) \n[Clang 11.0.3 (clang-1103.0.32.62)]
[1] from time import sleep...
[2] dh = display(display_id=True)
`This update remains`
[3] dh.update(Markdown('`Display Update Fun 1`'))...
[4] dh = display(Markdown('`Display Update Fun 2`'), display_id=True)...
`This update is supposed to remain`

Your Jupyter and/or Python environment

Please provide as much info as you readily know

  • Jupyter server running: Local
  • Extension version: 2020.8.105369
  • VS Code version: 1.48.2
  • Setting python.jediEnabled: false
  • Setting python.languageServer: PyLance
  • Python and/or Anaconda version: 3.7.3
  • OS: Mac
  • Virtual environment: venv

Python Output

There was no output.

Microsoft Data Science for VS Code Engineering Team: @rchiodo, @IanMatthewHuff, @DavidKutu, @DonJayamanne, @greazer, @joyceerhl

@IanMatthewHuff
Copy link
Member

@hsm thanks for the report, and sorry about the issue. I can confirm that something is off here. I repro the same issue and see that jupyter displays it correctly:
image

@emepetres
Copy link

I can confirm the issue. Below a couple of screenshots from the first notebook of the fastbook:

During training:
during

After training:
after

@zhangjiekui
Copy link

I also found the similar problem.
the proper behavior is an below.
but right after fine_tune completed, the result disappeared. when you close and reopen the .ipynb
the reslut (below) is there
1

@HeroadZ
Copy link

HeroadZ commented Sep 28, 2020

Same problem here. The result disappers when the training finished.

@DonJayamanne DonJayamanne transferred this issue from microsoft/vscode-python Nov 13, 2020
@DonJayamanne DonJayamanne added bug Issue identified by VS Code Team member as probable bug temp-parking and removed temp-parking labels Nov 13, 2020
@avylove
Copy link

avylove commented May 8, 2021

Any movement on this?

The only workaround I found was to call clear_output() and then use DisplayHandle.display() again, but that's not a good option because it clears all the output.

@DonJayamanne
Copy link
Contributor

@avylove Please could you install VS Code Insiders and try the new notebook UI and let us know if the problem has been resolved there?
Thanks

@avylove
Copy link

avylove commented May 10, 2021

Having an issue with the Jupyter extension on Insiders.

extension activation failed TypeError: o.getConfiguration(...).get(...).find is not a function

Or were you referring to something else?

@joyceerhl
Copy link
Contributor

@avylove Sorry, you're hitting #5804. As a temporary workaround, you can replace the workbench.editorAssociations setting with the following:

    "workbench.editorAssociations": [
        {
            "viewType": "jupyter-notebook",
            "filenamePattern": "*.ipynb"
        }
    ]

which should allow the extension to activate.

@avylove
Copy link

avylove commented May 11, 2021

The workaround wasn't working for me, but the new version did. There was some hanging with new interface at times, but this particular issue looks like it's resolved there.

@greazer greazer closed this as completed Jun 6, 2021
@avylove
Copy link

avylove commented Jun 6, 2021

I'm confused to why this was closed, particularly with no comment. While it seemed to work in the insiders version, that doesn't look like it's made it to general release yet. Please leave open until issue is deployed in a general release.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 14, 2021
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
Projects
None yet
Development

No branches or pull requests

9 participants