-
Notifications
You must be signed in to change notification settings - Fork 4
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
async cells are sometimes executed out of order #16
Comments
This is likely because I am on ipykernel 5.5.5. |
I don't claim to fully understand what I am doing here but this fixes the issue for me: diff --git a/jupyter_ui_poll/_poll.py b/jupyter_ui_poll/_poll.py
index 81fb11e..3f80957 100644
--- a/jupyter_ui_poll/_poll.py
+++ b/jupyter_ui_poll/_poll.py
@@ -89,9 +89,7 @@ class KernelWrapper:
if kernel._aborting:
kernel._send_abort_reply(stream, parent, ident)
else:
- rr = kernel.execute_request(stream, ident, parent)
- if self._kernel_is_async:
- await rr
+ await kernel.execute_request(stream, ident, parent)
# replicate shell_dispatch behaviour
sys.stdout.flush()
|
Thanks for the report @saraedum , I can't say I have tested async + older ipykernel, it could be that Code here can be improved though jupyter-ui-poll/jupyter_ui_poll/_poll.py Lines 92 to 94 in ce4e3d4
Probably most robust is to check whether |
Fixes Kirill888#16. In some cases ipykernel 5 returns an awaitable when executing a request. We need to await it to get the correct order of executing of async cells.
Fixes Kirill888#16. In some cases ipykernel 5 returns an awaitable when executing a request. We need to await it to get the correct order of execution of async cells.
Fixes #16. In some cases ipykernel 5 returns an awaitable when executing a request. We need to await it to get the correct order of execution of async cells.
Running all cells in this notebook (with Cell → Run All) executes cells out of order:
This happened with the latest version of this package and the latest notebook from conda-forge.
I am happy to provide more details if that is helpful.
The text was updated successfully, but these errors were encountered: