Skip to content

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

Closed

Description

@hsm

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: Rich Chiodo (@rchiodo), Ian Huff (@IanMatthewHuff), David Kutugata (@DavidKutu), Don Jayamanne (@DonJayamanne), Jim Griesmer (@greazer), Joyce Er (@joyceerhl)

Activity

  1. IanMatthewHuff commented on Sep 1, 2020

    @IanMatthewHuff
    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

  2. emepetres commented on Sep 10, 2020

    @emepetres

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

    During training:
    during

    After training:
    after

  3. zhangjiekui commented on Sep 22, 2020

    @zhangjiekui

    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

  4. HeroadZ commented on Sep 28, 2020

    @HeroadZ

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

  5. avylove commented on May 8, 2021

    @avylove

    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.

  6. DonJayamanne commented on May 10, 2021

    @DonJayamanne
    Contributor

    Avram Lubkin (@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

  7. avylove commented on May 10, 2021

    @avylove

    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?

  8. joyceerhl commented on May 10, 2021

    @joyceerhl
    Contributor

    Avram Lubkin (@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.

  9. avylove commented on May 11, 2021

    @avylove

    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.

  10. avylove commented on Jun 6, 2021

    @avylove

    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.

  11. locked as resolved and limited conversation to collaborators on Jun 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue identified by VS Code Team member as probable bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions