Skip to content

Panel Tabulator with Voila doesn't store user edits #6731

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
obrown06 opened this issue Apr 15, 2024 · 9 comments
Closed

Panel Tabulator with Voila doesn't store user edits #6731

obrown06 opened this issue Apr 15, 2024 · 9 comments

Comments

@obrown06
Copy link

obrown06 commented Apr 15, 2024

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".

image

When I edit the cell (e.g., to contain 432), we see the new value:

image

But when the button is pressed, the triggered callback still sees the original value:

image

Relevant versions:

panel                     1.4.1
voila                     0.5.6
ipywidgets                8.1.2
ipywidgets_bokeh          1.6.0
jupyter_bokeh             4.0.1
@obrown06 obrown06 changed the title Panel with Voila doesn't store user edits Panel Tabulator with Voila doesn't store user edits Apr 15, 2024
@Kalandoros
Copy link

Kalandoros commented Apr 20, 2024

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)).

@maximlt maximlt added the component: tabulator Related to the Tabulator widget label Apr 20, 2024
@obrown06
Copy link
Author

Any thoughts here? Or suggested workarounds?

@philippjfr
Copy link
Member

Could you try upgrading to jupyter_bokeh 4.0.4?

@Kalandoros
Copy link

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:
image reported in
voila-dashboards/voila#1435.

@obrown06
Copy link
Author

Any additional suggestions @philippjfr ?

@obrown06
Copy link
Author

obrown06 commented May 2, 2024

Should we assume this bug won't be addressed in the near term @philippjfr ?

@obrown06
Copy link
Author

Any signal here would be useful @philippjfr

@philippjfr
Copy link
Member

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.

@philippjfr philippjfr removed the component: tabulator Related to the Tabulator widget label May 15, 2024
@philippjfr
Copy link
Member

I'll close this as a duplicate of: #3963

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants