-
-
Notifications
You must be signed in to change notification settings - Fork 531
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
[WIP] Compatibility with Bokeh 3.0 (round 2) #3752
Conversation
This required change from, e.g.: static init_SomeModel {} to static {} (see 9698782). |
Perfect! With your change, I can now serve the simplest panel app. |
Unittest failing: FAILED panel/tests/test_links.py::test_bokeh_figure_jslink - ValueError: failed to validate TextInput(id='1301', ...).value: expected a value of type str, got nan of type float
FAILED panel/tests/test_util.py::test_render_mimebundle - TypeError: standalone_docs_json_and_render_items() takes 1 positional argument but 2 were given
FAILED panel/tests/io/test_embed.py::test_embed_merged_sliders - AssertionError: assert [{'attr': 'te..., 'new': '1'}] == [{'attr': 'te...'1881'}, ...}] The majority are changes that are related to holoviews and FAILED panel/tests/test_links.py::test_pnwidget_hvplot_links - AttributeError: unexpected attribute 'plot_height' to figure, similar attributes are outer_height, height or min_height
FAILED panel/tests/test_links.py::test_bkwidget_hvplot_links - AttributeError: unexpected attribute 'plot_height' to figure, similar attributes are outer_height, height or min_height
FAILED panel/tests/test_links.py::test_hvplot_jscallback - AttributeError: unexpected attribute 'plot_height' to figure, similar attributes are outer_height, height or min_height
FAILED panel/tests/test_links.py::test_link_with_customcode - AttributeError: unexpected attribute 'plot_height' to figure, similar attributes are outer_height, height or min_height
FAILED panel/tests/test_template.py::test_template_links_axes - AttributeError: unexpected attribute 'plot_height' to figure, similar attributes are outer_height, height or min_height
FAILED panel/tests/io/test_save.py::test_static_path_in_holoviews_save - AttributeError: unexpected attribute 'plot_height' to figure, similar attributes are outer_height, height or min_height
FAILED panel/tests/pane/test_holoviews.py::test_holoviews_pane_switch_backend - AttributeError: unexpected attribute 'plot_height' to figure, similar attributes are outer_height, height or min_height
FAILED panel/tests/pane/test_holoviews.py::test_holoviews_pane_bokeh_renderer - AttributeError: unexpected attribute 'plot_height' to figure, similar attributes are outer_height, height or min_height
FAILED panel/tests/pane/test_holoviews.py::test_holoviews_pane_initialize_empty - AttributeError: unexpected attribute 'plot_height' to figure, similar attributes are outer_height, height or min_height
FAILED panel/tests/pane/test_holoviews.py::test_holoviews_with_widgets - AttributeError: unexpected attribute 'plot_height' to figure, similar attributes are outer_height, height or min_height
FAILED panel/tests/pane/test_holoviews.py::test_holoviews_updates_widgets - AttributeError: unexpected attribute 'plot_height' to figure, similar attributes are outer_height, height or min_height
FAILED panel/tests/pane/test_holoviews.py::test_holoviews_widgets_update_plot - AttributeError: unexpected attribute 'plot_height' to figure, similar attributes are outer_height, height or min_height
FAILED panel/tests/pane/test_holoviews.py::test_holoviews_with_widgets_not_shown - AttributeError: unexpected attribute 'plot_height' to figure, similar attributes are outer_height, height or min_height
FAILED panel/tests/pane/test_holoviews.py::test_holoviews_layouts - AttributeError: unexpected attribute 'plot_height' to figure, similar attributes are outer_height, height or min_height
FAILED panel/tests/pane/test_holoviews.py::test_holoviews_linked_axes - AttributeError: unexpected attribute 'plot_height' to figure, similar attributes are outer_height, height or min_height
FAILED panel/tests/pane/test_holoviews.py::test_holoviews_linked_axes_flexbox - AttributeError: unexpected attribute 'plot_height' to figure, similar attributes are outer_height, height or min_height
FAILED panel/tests/pane/test_holoviews.py::test_holoviews_linked_axes_merged_ranges - AttributeError: unexpected attribute 'plot_height' to figure, similar attributes are outer_height, height or min_height
FAILED panel/tests/pane/test_holoviews.py::test_holoviews_linked_x_axis - AttributeError: unexpected attribute 'plot_height' to figure, similar attributes are outer_height, height or min_height
FAILED panel/tests/pane/test_holoviews.py::test_holoviews_axiswise_not_linked_axes - AttributeError: unexpected attribute 'plot_height' to figure, similar attributes are outer_height, height or min_height
FAILED panel/tests/pane/test_holoviews.py::test_holoviews_shared_axes_opt_not_linked_axes - AttributeError: unexpected attribute 'plot_height' to figure, similar attributes are outer_height, height or min_height
FAILED panel/tests/pane/test_holoviews.py::test_holoviews_not_linked_axes - AttributeError: unexpected attribute 'plot_height' to figure, similar attributes are outer_height, height or min_height
FAILED panel/tests/pane/test_holoviews.py::test_holoviews_link_across_panes - AttributeError: unexpected attribute 'plot_height' to figure, similar attributes are outer_height, height or min_height
FAILED panel/tests/pane/test_holoviews.py::test_holoviews_link_after_adding_item - AttributeError: unexpected attribute 'plot_height' to figure, similar attributes are outer_height, height or min_height
FAILED panel/tests/pane/test_holoviews.py::test_holoviews_link_within_pane - AttributeError: unexpected attribute 'plot_height' to figure, similar attributes are outer_height, height or min_height
FAILED panel/tests/pane/test_holoviews.py::test_holoviews_property_override - AttributeError: unexpected attribute 'plot_height' to figure, similar attributes are outer_height, height or min_height |
No, |
You should run pytest with |
|
Failing examples (on ubuntu) FAILED examples/user_guide/Deploy_and_Export.ipynb::Cell 9
FAILED examples/user_guide/Pipelines.ipynb::Cell 8
FAILED examples/user_guide/Pipelines.ipynb::Cell 9
FAILED examples/user_guide/Pipelines.ipynb::Cell 12
FAILED examples/user_guide/Pipelines.ipynb::Cell 13
FAILED examples/user_guide/Pipelines.ipynb::Cell 16
FAILED examples/reference/widgets/Tabulator.ipynb::Cell 33
FAILED examples/reference/widgets/Tabulator.ipynb::Cell 34
FAILED examples/reference/widgets/Tabulator.ipynb::Cell 35
FAILED examples/reference/widgets/Tabulator.ipynb::Cell 47
FAILED examples/gallery/links/bokeh_property_editor.ipynb::Cell 5
FAILED examples/gallery/param/reactive_plots.ipynb::Cell 3
FAILED examples/gallery/simple/iris_kmeans.ipynb::Cell 1 |
Trying to run panel in a notebook and get the following console errors: import os
os.getenv("BOKEH_RESOURCES")
import panel as pn
pn.extension()
pn.widgets.IntSlider() Kernel: restarting (2e904f74-ba0f-4af4-b441-67884fd14eee) jlab_core.081dc2b13065c79d8463.js:2:997341
Some cookies are misusing the recommended “SameSite“ attribute 38
Connection lost, reconnecting in 0 seconds. jlab_core.081dc2b13065c79d8463.js:2:996773
Starting WebSocket: ws://localhost:8889/api/kernels/2e904f74-ba0f-4af4-b441-67884fd14eee jlab_core.081dc2b13065c79d8463.js:2:982794
Kernel: starting (2e904f74-ba0f-4af4-b441-67884fd14eee) jlab_core.081dc2b13065c79d8463.js:2:997341
Failed to fetch ipywidgets through the "jupyter.widget.control" comm channel, fallback to fetching individual model state. Reason: Control comm was closed too early 272.3fcd6d7045eecfb56da6.js:1:10870
Bokeh: BokehJS not loaded, scheduling load and callback at
Date Sat Aug 13 2022 12:19:11 GMT+0200 (Central European Summer Time)
Untitled.ipynb line 2 > injectedScript:44:13
Bokeh: injecting link tag for BokehJS stylesheet: https://cdn.jsdelivr.net/npm/notyf@3/notyf.min.css Untitled.ipynb line 2 > injectedScript:66:15
Bokeh: injecting link tag for BokehJS stylesheet: https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css Untitled.ipynb line 2 > injectedScript:66:15
Bokeh: all BokehJS libraries/stylesheets loaded Untitled.ipynb line 2 > injectedScript:49:17
Bokeh: BokehJS plotting callback run at
Date Sat Aug 13 2022 12:19:11 GMT+0200 (Central European Summer Time)
Untitled.ipynb line 2 > injectedScript:1717:15
[bokeh] setting log level to: 'info' Untitled.ipynb line 2 > injectedScript:342:1317
Bokeh: all callbacks have finished Untitled.ipynb line 2 > injectedScript:27:13
Error: Promised response from onMessage listener went out of scope background.js:841:170
Uncaught Error: panel.models.comm_manager.CommManager(1002).plot_id is unset
get_value http://localhost:8889/lab/workspaces/auto-Y/tree/Untitled.ipynb line 2 > injectedScript:341
get http://localhost:8889/lab/workspaces/auto-Y/tree/Untitled.ipynb line 2 > injectedScript:338
r http://localhost:8889/lab/workspaces/auto-Y/tree/Untitled.ipynb line 2 > injectedScript:1546
_decode_object_ref http://localhost:8889/lab/workspaces/auto-Y/tree/Untitled.ipynb line 2 > injectedScript:371
_decode http://localhost:8889/lab/workspaces/auto-Y/tree/Untitled.ipynb line 2 > injectedScript:371
_decode_plain_array http://localhost:8889/lab/workspaces/auto-Y/tree/Untitled.ipynb line 2 > injectedScript:371
c http://localhost:8889/lab/workspaces/auto-Y/tree/Untitled.ipynb line 2 > injectedScript:337
_decode_plain_array http://localhost:8889/lab/workspaces/auto-Y/tree/Untitled.ipynb line 2 > injectedScript:371
_decode http://localhost:8889/lab/workspaces/auto-Y/tree/Untitled.ipynb line 2 > injectedScript:371
n http://localhost:8889/lab/workspaces/auto-Y/tree/Untitled.ipynb line 2 > injectedScript:371
decode http://localhost:8889/lab/workspaces/auto-Y/tree/Untitled.ipynb line 2 > injectedScript:371
from_json http://localhost:8889/lab/workspaces/auto-Y/tree/Untitled.ipynb line 2 > injectedScript:324
embed_items_notebook http://localhost:8889/lab/workspaces/auto-Y/tree/Untitled.ipynb line 2 > injectedScript:406
embed_document http://localhost:8889/lab/workspaces/auto-Y/tree/Untitled.ipynb line 2 > injectedScript:5
<anonymous> http://localhost:8889/lab/workspaces/auto-Y/tree/Untitled.ipynb line 2 > injectedScript:17
<anonymous> http://localhost:8889/lab/workspaces/auto-Y/tree/Untitled.ipynb line 2 > injectedScript:33
attachWidget http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
insertWidget http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
_insertOutput http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
onModelChanged http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
m http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
l http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
emit http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
_onListChanged http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
m http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
l http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
emit http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
push http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
_add http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
add http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
_onIOPub http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
_handleIOPub http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
handleMsg http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
_handleMessage http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
_msgChain http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
promise callback*19883/b/this._onWSMessage http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
_createSocket http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
setTimeout handler*_reconnect http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
reconnect http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
restart http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
restartKernel http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
restart http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
restartKernel http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
r http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
execute http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
triggerActiveItem http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
_evtMouseUp http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
handleEvent http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
onBeforeAttach http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
processMessage http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
b http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
t http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
r http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
c http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
open http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
_openChildMenu http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
_evtMouseDown http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
handleEvent http://localhost:8889/static/lab/jlab_core.081dc2b13065c79d8463.js?v=081dc2b13065c79d8463:2
Untitled.ipynb line 2 > injectedScript:341:1600
Error: Promised response from onMessage listener went out of scope 2 background.js:841:170
|
Given this definition: plot_id = String() plot_id: p.Property<string | null> plot_id: [ String ], the behavior is correct. Bokeh's properties don't allow implicit To support nullable properties, the type needs to be wrapped in plot_id = Nullable(String) plot_id: p.Property<string | null> plot_id: [ Nullable(String), null ], |
The intrinsic default is |
To create a required (no default value) nullable property, use: plot_id = Required(Nullable(String)) Unless |
I have implemented your suggested changes but still got the error. From what I could see in the python codebase, when What seems to be the problem is that With the changes in 6c94a75, I can get a Panel widget and pane to render in Jupyter. The problem is I get no sync with the widget and Python, and I have little idea where to look to get this to work. If I use
|
That's the only way. If inheriting from
It's beneficial, but optional by default. You can add: "noImplicitOverride": true, to panel's
Sync fails because of |
@philippjfr removed your pin commit as it could not solve the environment [ref]. Have solved some notebook related problems: |
Buffers are now a custom class This gives a problem here: Lines 160 to 163 in 84d8aec
And here: Lines 74 to 76 in 84d8aec
|
Yes, see here https://github.com/bokeh/bokeh/blob/branch-3.0/bokeh/protocol/message.py#L271-L277. I'm wondering if panel really has to go that low-level. I suppose this is something to discuss after the migration. |
We may restore that as discussed in the referenced issue. I also implemented actual serialization support for range iterators, but actually supporting this on bokehjs' side is a more complex matter. |
Codecov Report
@@ Coverage Diff @@
## master #3752 +/- ##
==========================================
- Coverage 83.58% 74.97% -8.61%
==========================================
Files 223 222 -1
Lines 33243 32705 -538
==========================================
- Hits 27785 24521 -3264
- Misses 5458 8184 +2726
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@mattpap I have added a script that gives an overview of many of Panels custom Bokeh models in 08857d2. I have run it with bokeh 2.4 and get the following HTML: models_bokeh2.zip |
No more JavaScript build errors but some notes on things I removed:
|
This was superseded by #4098 and has now been merged in |
Definitely a WIP
Status / Todo
(Not an exhaustive list)
panel serve
to run with a simple scriptbokeh.models.DatePicker
inpanel.models.DatetimePicker
Simple panel script running
With these changes, I can get the panel to build with bokeh 3.0 and serve a simple script as this with
BOKEH_DEV=true BOKEH_RESOURCES=server panel serve
:I did not continue on Philipps original pull requests #3072 as it is six months old, and I still want to use it for lookup.
Linting and removal of commented code lines will be done later.