holoviz / holoviz/hvplot

Streaming example fails

Open
#1,500 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.4k
Forks
124
Avg merge
1d 18h
Merged PRs (30d)
1

Description

#### ALL software version info
(this library, plus any other relevant software, e.g. bokeh, python, notebook, OS, browser, etc should be added within the dropdown below.)

Software Version Info

```plaintext
Include version information here

python 3.12.9 h9e4cc4f_0_cpython conda-forge
hvplot 0.11.2 pyhd8ed1ab_0 conda-forge
streamz 0.6.4 pyhd8ed1ab_1 conda-forge
bokeh 3.6.3 pyhd8ed1ab_0 conda-forge
numpy 2.2.3 py312h72c5963_0 conda-forge

```

#### Description of expected behavior and the observed behavior

The first streaming example on https://hvplot.holoviz.org/user_guide/Streaming.html raises numpy exception, also shows hvplot deprecation message.

#### Complete, minimal, self-contained example code that reproduces the issue

```python
# code goes here between backticks
from streamz.dataframe import Random
import hvplot.streamz # noqa
df = Random(interval='500ms', freq='50ms')
df.hvplot()
```

#### Stack traceback and/or browser JavaScript console output
/home/george/miniforge3/envs/aawu/lib/python3.12/site-packages/hvplot/converter.py:100): ParamFutureWarning: `get_param_values` has been deprecated and will be removed in a future version. Use `.param.values().items()` instead (or `.param.values()` for the common case of `dict(....param.get_param_values())`)
old = {k: v for k, v in self.param.get_param_values() if k not in ['callable', 'name']}
```
Traceback (most recent call last):
File "/home/george/miniforge3/envs/aawu/lib/python3.12/site-packages/pyviz_comms/__init__.py", line 339, in _handle_msg
self._on_msg(msg)
File "/home/george/miniforge3/envs/aawu/lib/python3.12/site-packages/panel/viewable.py", line 493, in _on_msg
patch.apply_to_document(doc, comm.id if comm else None)
File "/home/george/miniforge3/envs/aawu/lib/python3.12/site-packages/bokeh/protocol/messages/patch_doc.py", line 104, in apply_to_document
invoke_with_curdoc(doc, lambda: doc.apply_json_patch(self.payload, setter=setter))
File "/home/george/miniforge3/envs/aawu/lib/python3.12/site-packages/bokeh/document/callbacks.py", line 453, in invoke_with_curdoc
return f()
^^^
File "/home/george/miniforge3/envs/aawu/lib/python3.12/site-packages/bokeh/protocol/messages/patch_doc.py", line 104, in
invoke_with_curdoc(doc, lambda: doc.apply_json_patch(self.payload, setter=setter))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/george/miniforge3/envs/aawu/lib/python3.12/site-packages/bokeh/document/document.py", line 391, in apply_json_patch
DocumentPatchedEvent.handle_event(self, event, setter)
File "/home/george/miniforge3/envs/aawu/lib/python3.12/site-packages/bokeh/document/events.py", line 244, in handle_event
event_cls._handle_event(doc, event)
File "/home/george/miniforge3/envs/aawu/lib/python3.12/site-packages/bokeh/document/events.py", line 566, in _handle_event
model._stream(data, rollover, event.setter)
File "/home/george/miniforge3/envs/aawu/lib/python3.12/site-packages/bokeh/models/sources.py", line 577, in _stream
self.data._stream(self.document, self, new_data, rollover, setter)
File "/home/george/miniforge3/envs/aawu/lib/python3.12/site-packages/bokeh/core/property/wrappers.py", line 492, in _stream
seq = np.append(old_seq, new_seq)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/george/miniforge3/envs/aawu/lib/python3.12/site-packages/numpy/lib/_function_base_impl.py", line 5711, in append
return concatenate((arr, values), axis=axis)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
numpy.exceptions.DTypePromotionError: The DType could not be promoted by . This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is `object`. The full list of DTypes is: (, )
```
The traceback repeats, although the plot does show up in Jupyter.
#### Screenshots or screencasts of the bug in action

- [ ] I may be interested in making a pull request to address this

Contributor guide

Open the contributing guide

Research direction

Start by running the first Streaming example with the listed Python, hvplot, streamz, Bokeh, and NumPy versions. Inspect the hvplot.streamz path and the Bokeh traceback around streaming data, then verify that the example no longer repeats the NumPy dtype exception and that the reported deprecation warning is addressed.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, numpy, python
Domain
data-visualization, stream-processing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.