-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[BUG] Live Progress Bars Double-Render in Jupyter Notebooks #1737
Comments
Narrowing this down: Was able to replicate the bug reported here and was able to narrow it down to differences between 10.15.0 and 10.15.1 All version of rich from 10.13.0 through 10.14 didn't have the double render. Looking at the pull request that got merged, the code that was merged references thread safety. It might be some kind of race condition between multiple threads. |
@christina-yun @nicholaswold Can you check if @willmcgugan's recent fix released as 10.15.2 resolves the behavior that we have seen on 10.15.1? Thanks Will for a great library! |
@willingc - Thank you for the suggestion. I went ahead and tested 10.15.2 and it still has the same issue as 10.15.1 that @nicholaswold and I were able to replicate yesterday. |
Thanks for narrowing this down. I'll take a look soon. |
I think I have a fix for that. Please give 10.15.3a1 a try. There are also changes there to workaround issues with thread-safety in Jupyter. So I'd appreciate it if you could try it against any code with progress bars. |
The fix looks like it works for the originally reported example and another notebook with some progress bars. Thanks @willmcgugan. Will let you know if I see anything else. |
That's in 10.16.0 now |
Did I solve your problem? Consider sponsoring the ongoing work on Rich and Textual. Or buy me a coffee to say thanks. |
10.16.2 Fixed Fixed @ not being escaped in markup 10.16.1 Fixed Fixed issues with overlapping tags Textualize/rich#1755 10.16.0 Fixed Double print of progress bar in Jupyter Textualize/rich#1737 Added Added Text.markup property Textualize/rich#1751
Describe the bug
Upgrading to
10.15.1
from10.13.0
causes a double-render when using a live progress bar in a Jupyter Notebook. You can see this easily using the following example code:If it matters, we were using
ipywidgets==7.6.5
for this example above. Rolling back torich==10.13.0
fixed the issue.You can see the section below for a description of what's happening in the Jupyter messaging protocol, but my best guess is that the ipywidgets usage is slightly off and causing this bug.
ipywidgets specifics
Normally when you update an output widget it fires the following messages:
comm_msg
that specifies that all future messages apply to a specific output modelclear_output
message withwait=True
display_data
message including the new contentcomm_msg
that specifies that future messages no longer apply to a specific output modelWe were noticing that this is still the case except for the final update message, in which it does the following:
comm_msg
that specifies that all future messages apply to a specific output modelclear_output
message withwait=True
comm_msg
that specifies that future messages no longer apply to a specific output modeldisplay_data
message including the new contentThe swap of those two messages caused the double-render, because the old render is never cleared by an output to that widget model, and the display_data is tracked as a new output for the cell.
Platform
Underlying platform is linux, using the classic Jupyter interface. This also happened using Noteable's interface.
The text was updated successfully, but these errors were encountered: