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
/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 <lambda>
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 <class 'numpy.dtypes.DateTime64DType'> could not be promoted by <class 'numpy.dtypes.Float64DType'>. 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: (<class 'numpy.dtypes.DateTime64DType'>, <class 'numpy.dtypes.Float64DType'>)
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
The text was updated successfully, but these errors were encountered:
I think I know what causes the above behaviour. The exception is raised when np.append is called by PropertyValueColumnData._stream in file bokeh/core/property/wrappers.py when the arguments are of type np.datatime64 and np.float64. This happens because the initial data field in ColumnarDataSource, file bokeh/core/models/sources.py during class instantiation is not converted. Adding the conversion to __init__ seems to work:
for key, values in self.data.items():
# Apply the transformation if the data contains datetimes
if isinstance(values, np.ndarray) and values.dtype.kind.lower() == 'm':
self.data[key] = convert_datetime_array(values)
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
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
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 ofdict(....param.get_param_values())
)old = {k: v for k, v in self.param.get_param_values() if k not in ['callable', 'name']}
The traceback repeats, although the plot does show up in Jupyter.
Screenshots or screencasts of the bug in action
The text was updated successfully, but these errors were encountered: