You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A common experience with using pydeck are silent failures. This occurs when running code in a python notebook but seeing no output (a blank output cell). What is actually occurring is that the IPython.display.HTML object has encountered a Javascript error during its render (display) operation. This error is not propagated from the client browser to the python notebook runtime.
The only way to discover this error is to review the browser’s Javascript console output (for example, manually opening the Console panel from Chrome’s Dev Tools). This creates friction for python notebooks as it takes the user outside their normal workflow.
Examples of this friction can be seen from issues filed for pydeck:
A better user experience would be to display the Javascript error and fail the notebook cell operation. Notebook users would get feedback immediately so as to fix their code or, more typically, their deck.gl layer parameters.
Console errors can then be propagated from the client browser back to the python notebook runtime.
The receiver callback registered in step 1n can raise a python exception to propagate the error back to the user and fail the notebook’s cell operation.
If synchronization is required, a python condition object can be used to ensure safe waiting on these messages.
Optional If google.colab is unavailable, the Jinja template can still be modified to at least display the Javascript error in a <div/> or <code/> HTML element. Although the error is still displayed to the user immediately, the only drawback of this approach is that the notebook’s cell operation will not be marked as an error (a false positive). Still, showing output is still a major UX improvement over the current behavior of no output.
The text was updated successfully, but these errors were encountered:
bijanvakili
changed the title
[Feat] Propagate Javascript errors to notebook cells when using pydeck in Colab
[Feat] [pydeck] Propagate Javascript errors to notebook cells when using pydeck in Colab
Jan 21, 2025
Target Use Case
A common experience with using pydeck are silent failures. This occurs when running code in a python notebook but seeing no output (a blank output cell). What is actually occurring is that the IPython.display.HTML object has encountered a Javascript error during its render (display) operation. This error is not propagated from the client browser to the python notebook runtime.
The only way to discover this error is to review the browser’s Javascript console output (for example, manually opening the Console panel from Chrome’s Dev Tools). This creates friction for python notebooks as it takes the user outside their normal workflow.
Examples of this friction can be seen from issues filed for pydeck:
Proposal
A better user experience would be to display the Javascript error and fail the notebook cell operation. Notebook users would get feedback immediately so as to fix their code or, more typically, their deck.gl layer parameters.
pydeck already has logic here to detect the
google.colab
package. This can be extended to use Colab's Javascript to Python communication.More specifically:
google.colab.output.register_callback
If synchronization is required, a python condition object can be used to ensure safe waiting on these messages.
Optional If
google.colab
is unavailable, the Jinja template can still be modified to at least display the Javascript error in a<div/>
or<code/>
HTML element. Although the error is still displayed to the user immediately, the only drawback of this approach is that the notebook’s cell operation will not be marked as an error (a false positive). Still, showing output is still a major UX improvement over the current behavior of no output.The text was updated successfully, but these errors were encountered: