Deserialization warning with Bokeh 2.1
Closed this issue ยท 18 comments
The dashboard broke under 2.1. It has been resolved in #3904
However, we're still getting a deserialization error like the following:
message: Message 'PATCH-DOC' content: {'references': [], 'events': [{'kind': 'ModelChanged', 'model': {'id': '1683'}, 'attr': 'text_align', 'new': {'value': 'right'}}, {'kind': 'ModelChanged', 'model': {'id': '1684'}, 'attr': 'text_align', 'new': {'value': 'right'}}, {'kind': 'ModelChanged', 'model': {'id': '1628'}, 'attr': 'reset_start', 'new': -8}, {'kind': 'ModelChanged', 'model': {'id': '1628'}, 'attr': 'reset_end', 'new': 0}]}
error: DeserializationError("Enum('left', 'right', 'center') expected str, got {'value': 'right'} of type dict")
Traceback (most recent call last):
File "/home/mrocklin/miniconda/envs/test-3714/lib/python3.8/site-packages/bokeh/server/protocol_handler.py", line 90, in handle
work = await handler(message, connection)
File "/home/mrocklin/miniconda/envs/test-3714/lib/python3.8/site-packages/bokeh/server/session.py", line 67, in _needs_document_lock_wrapper
result = func(self, *args, **kwargs)
File "/home/mrocklin/miniconda/envs/test-3714/lib/python3.8/site-packages/bokeh/server/session.py", line 261, in _handle_patch
message.apply_to_document(self.document, self)
File "/home/mrocklin/miniconda/envs/test-3714/lib/python3.8/site-packages/bokeh/protocol/messages/patch_doc.py", line 100, in apply_to_document
doc._with_self_as_curdoc(lambda: doc.apply_json_patch(self.content, setter))
File "/home/mrocklin/miniconda/envs/test-3714/lib/python3.8/site-packages/bokeh/document/document.py", line 1150, in _with_self_as_curdoc
return f()
File "/home/mrocklin/miniconda/envs/test-3714/lib/python3.8/site-packages/bokeh/protocol/messages/patch_doc.py", line 100, in <lambda>
doc._with_self_as_curdoc(lambda: doc.apply_json_patch(self.content, setter))
File "/home/mrocklin/miniconda/envs/test-3714/lib/python3.8/site-packages/bokeh/document/document.py", line 411, in apply_json_patch
patched_obj.set_from_json(attr, value, models=references, setter=setter)
File "/home/mrocklin/miniconda/envs/test-3714/lib/python3.8/site-packages/bokeh/core/has_props.py", line 341, in set_from_json
descriptor.set_from_json(self, json, models, setter)
File "/home/mrocklin/miniconda/envs/test-3714/lib/python3.8/site-packages/bokeh/core/property/descriptors.py", line 611, in set_from_json
self.property.from_json(json, models),
File "/home/mrocklin/miniconda/envs/test-3714/lib/python3.8/site-packages/bokeh/core/property/bases.py", line 463, in from_json
raise DeserializationError("%s expected %s, got %s of type %s" % (self, expected, json, type(json).__name__))
bokeh.core.property.bases.DeserializationError: Enum('left', 'right', 'center') expected str, got {'value': 'right'} of type dictThis comes about from the TaskProgress plot available here:
distributed/distributed/dashboard/components/scheduler.py
Lines 1488 to 1662 in 1d7640b
It looks to me that if you remove the text_align = "right" line you will be good, but I don't know if that is desirable.
Is there a new way to align text?
OK great. It sounds like the thing for us to do is to sit tight on the Dask side. Correct?
Yes seems we broke a few eggs with this release unfortunately.
It's ok, you all make a mean omelet.
@mrocklin @jsignell Bokeh 2.1.1 is available on PyPI and the bokeh channel on anaconda.org (presumably soon on C-F also) It should resolve this issue (but please test in your actual usage first!)
Tangentially: how can we help augment the downstream tests? I plan to raise the visibility of the adivsory downstream tests soon, but that said, they were all still passing even with both issues 2.1 introduced
Would it make sense for dask to mark some tests as visualization tests and then bokeh could run them on some schedule? Probably released dask + latest bokeh is good enough for testing right?
@jsignell That's what we do already:
https://github.com/bokeh/bokeh/runs/798587187?check_suite_focus=true
But evidently not enough already, since it did not catch either of the issues with the 2.1 release.
Yes sorry should have circled back after the dask dev meeting yesterday. I am going to look over the tests in dask and see if there are any holes in the testing that would be easy to fix.
Did we wind up resolving this or is this still an issue?
@jakirkham AFAIK Bokeh 2.1.1 resolved the immediate problem on the Bokeh side, I am not sure if version 2.1 can/was specifically excluded from requirements on the Dask side. Another option would be to set Bokeh 2.1.1 a a new min version which I would certainly endorse ๐ (it is ~18 months old at this point which seem like a lot in dask-time)
Guessing we would want to update this then
@jrbourbeau feel free to point any other spots I've missed :)
RIght, there's at least that and some docs spots IIRC, and there may be some old version-detection code that could be chucked out. If there's agreement to set 2.1.1 as a new minimum, I am happy to take a comprehensive look and submit a PR.
Yeah I'd be happy to have the min be 2.1.1
Yeah, if bumping the minimum supported version to 2.1.1. will cut down on user pain or maintainer burden, then let's do it
See
Thanks Bryan! ๐