ValueError when editing tabulator created with Tabulator.from_param

Hello,
when I click on a cell of a tabulator created with pn.widgets.Tabulator.from_param I get a ValueError in the console.
ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

I’m using the latest version of Panel: 1.8.10

Here is a minimal reproducible example:

import pandas as pd
import panel as pn
import param
from panel.viewable import Viewer

pn.extension('tabulator')


class TabulatorFromParamDemo(Viewer):
    df = param.DataFrame(
        default=pd.DataFrame(
            [
                {"String": "A", "Number": 10.0},
                {"String": "B", "Number": 25.5},
            ]
        )
    )

    def __init__(self, **params):
        super().__init__(**params)
        self.table = pn.widgets.Tabulator.from_param(self.param.df)
        self.layout = pn.Column(self.table)

    def __panel__(self):
        return self.layout


TabulatorFromParamDemo().servable()

I believe it will be addressed here:

1 Like