Panel Tabulator with Voila doesn't store user edits
obrown06 opened this issue · comments
Example code:
import pandas as pd
import panel as pn
from bokeh.models.widgets.tables import NumberEditor
pn.extension('tabulator')
out = widgets.Output()
test_df = pd.DataFrame(columns=[
"test_column_name",
])
test_df.loc[0] = [1]
test_df_widget = pn.widgets.Tabulator(test_df, editors={
"test_column_name": NumberEditor(),
})
test_button = widgets.Button(
description="Compare",
)
def test_on_click(b):
curr_df = test_df_widget.value
with out:
display(curr_df.iloc[0]["test_column_name"])
test_button.on_click(test_on_click)
with out:
display(test_df_widget, test_button)
out
Running this code in a voila app, we see a table displayed with a value of "1" in row 1, column "test_column_name".
When I edit the cell (e.g., to contain 432), we see the new value:
But when the button is pressed, the triggered callback still sees the original value:
Relevant versions:
panel 1.4.1
voila 0.5.6
ipywidgets 8.1.2
ipywidgets_bokeh 1.6.0
jupyter_bokeh 4.0.1
I can confirm the issue which has been also repoerted previuosly (see https://github.com/holoviz/panel/issues/3963)
It has been reported also in the voila repositorysince I wasn't sure where theorign of the bug is coming from (whether Panel or Voila) ([https://github.com/voila-dashboards/voila/issues/1435)).
Any thoughts here? Or suggested workarounds?
Could you try upgrading to jupyter_bokeh 4.0.4?
I tested it with jupyter_bokeh 4.0.4 but the issue is still perisisting.
It might be related to
Failed to create module: package: @pyviz/jupyterlab_pyviz; module: ./extension
:
reported in
voila-dashboards/voila#1435.
Any additional suggestions @philippjfr ?
Should we assume this bug won't be addressed in the near term @philippjfr ?
Any signal here would be useful @philippjfr
Honestly, I don't know much about the internals of Voila, all I can say is that jupyter_bokeh works well in many other contexts (i.e. VSCode, Google Colab and in other Jupyter environments), so I'd consider this a Voila bug, not a Panel one.
I'll close this as a duplicate of: #3963