holoviz / panel

Panel: The powerful data exploration & web app framework for Python
https://panel.holoviz.org
BSD 3-Clause "New" or "Revised" License
4.83k stars 520 forks source link

Bokeh serialisation KeyError in interactivity tutorial #6579

Open cdeil opened 8 months ago

cdeil commented 8 months ago

It looks like this example is currently broken?

https://holoviz-dev.github.io/panel/tutorials/intermediate/interactivity.html

Screenshot 2024-03-26 at 08 45 59
Uncaught (in promise) PythonError: Traceback (most recent call last):
  File "/lib/python311.zip/_pyodide/_base.py", line 573, in eval_code_async
    await CodeRunner(
  File "/lib/python311.zip/_pyodide/_base.py", line 393, in run_async
    coroutine = eval(self.code, globals, locals)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<exec>", line 7, in <module>
  File "/lib/python3.11/site-packages/bokeh/document/document.py", line 374, in apply_json_patch
    patch: PatchJson = deserializer.deserialize(patch_json)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/bokeh/core/serialization.py", line 520, in deserialize
    return self.decode(obj)
           ^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/bokeh/core/serialization.py", line 533, in decode
    return self._decode(obj)
           ^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/bokeh/core/serialization.py", line 574, in _decode
    return {key: self._decode(val) for key, val in obj.items()}
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/bokeh/core/serialization.py", line 574, in <dictcomp>
    return {key: self._decode(val) for key, val in obj.items()}
                 ^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/bokeh/core/serialization.py", line 576, in _decode
    return [self._decode(entry) for entry in obj]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/bokeh/core/serialization.py", line 576, in <listcomp>
    return [self._decode(entry) for entry in obj]
            ^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/bokeh/core/serialization.py", line 574, in _decode
    return {key: self._decode(val) for key, val in obj.items()}
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/bokeh/core/serialization.py", line 574, in <dictcomp>
    return {key: self._decode(val) for key, val in obj.items()}
                 ^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/bokeh/core/serialization.py", line 555, in _decode
    return self._decode_map(cast(MapRep, obj))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/bokeh/core/serialization.py", line 606, in _decode_map
    return { self._decode(key): self._decode(val) for key, val in entries }
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/bokeh/core/serialization.py", line 606, in <dictcomp>
    return { self._decode(key): self._decode(val) for key, val in entries }
                                ^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/bokeh/core/serialization.py", line 563, in _decode
    return self._decode_ndarray(cast(NDArrayRep, obj))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/bokeh/core/serialization.py", line 667, in _decode_ndarray
    decoded = self._decode(array)
              ^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/bokeh/core/serialization.py", line 557, in _decode
    return self._decode_bytes(cast(BytesRep, obj))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/bokeh/core/serialization.py", line 616, in _decode_bytes
    id = data["id"]
         ~~~~^^^^^^
KeyError: 'id'

    at new_error (pyodide.asm.js:9:10014)
    at pyodide.asm.wasm:0x158e62
    at pyodide.asm.wasm:0x15ff9e
    at _PyEM_TrampolineCall_JS (pyodide.asm.js:9:120223)
    at pyodide.asm.wasm:0x1a3494
    at pyodide.asm.wasm:0x28a2bd
    at pyodide.asm.wasm:0x1e431e
    at pyodide.asm.wasm:0x1a397d
    at pyodide.asm.wasm:0x1a3c3e
    at pyodide.asm.wasm:0x1a3ce0
    at pyodide.asm.wasm:0x2689a4
    at pyodide.asm.wasm:0x26e800
    at pyodide.asm.wasm:0x1a3e08
    at pyodide.asm.wasm:0x1a3a98
    at pyodide.asm.wasm:0x15f76b
    at Module.callPyObjectKwargs (pyodide.asm.js:9:64297)
    at Module.callPyObject (pyodide.asm.js:9:65365)
    at wrapper (pyodide.asm.js:9:32855)
philippjfr commented 8 months ago

Fixed in https://github.com/holoviz-dev/nbsite/pull/305

philippjfr commented 8 months ago

Will reopen until a new doc build confirms the fix.