holoviz / panel

Panel: The powerful data exploration & web app framework for Python

Home Page:https://panel.holoviz.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using Rasterize in a hvPlot figure shows an error with Panel 1.4.3

Azaya89 opened this issue · comments

ALL software version info

  • Panel 1.4.3
  • Bokeh 3.4.1
  • Notebook 7.0.6
  • Python 3.9.19

Description of expected behavior and the observed behavior

Using the rasterize parameter shows a Traceback error just before the plot is rendered. However, without the rasterize parameter it works fine without any Traceback shown.

However, on downgrading to Panel 1.4.2, the error is not shown and the plots with rasterize render fine.

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

Example code:

import numpy as np
import pandas as pd
import hvplot.pandas

x = np.linspace(0, 10, 1000)
y = np.linspace(0, 10, 1000)
xx, yy = np.meshgrid(x, y)
zz = np.sin(xx) * np.cos(yy)

df = pd.DataFrame({'x': xx.flatten(), 'y': yy.flatten(), 'z': zz.flatten()})

# Plot without rasterization renders fine
df.hvplot.scatter(x='x', y='y', c='z')

# Plot with rasterization shows the Traceback error
df.hvplot.scatter(x='x', y='y', c='z', rasterize=True)

Stack traceback and/or browser JavaScript console output

Traceback (most recent call last):
  File "/Users/mac/Documents/development/envs/default/lib/python3.9/site-packages/pyviz_comms/__init__.py", line 340, in _handle_msg
    self._on_msg(msg)
  File "/Users/mac/Documents/development/envs/default/lib/python3.9/site-packages/panel/viewable.py", line 469, in _on_msg
    patch = manager.assemble(msg)
  File "/Users/mac/Documents/development/envs/default/lib/python3.9/site-packages/panel/models/comm_manager.py", line 29, in assemble
    msg_obj = cls(header, msg['metadata'], msg['content'])
KeyError: 'content'

Thanks for reporting; duplicate of #6865