jupyter-widgets / ipydatagrid

Fast Datagrid widget for the Jupyter Notebook and JupyterLab
BSD 3-Clause "New" or "Revised" License
579 stars 51 forks source link

Databricks compatibility #536

Open xiaobigmeow opened 3 months ago

xiaobigmeow commented 3 months ago

Is it possible to run ipydatagrid in Databricks?

When I tried to run a simple example, I get an error: Error displaying widget: Cannot read properties of undefined (reading 'length')

martinRenou commented 3 months ago

Thanks for opening an issue, which simple example have you tried?

Looking at the error message, you may have found an actual bug in the ipydatagrid TypeScript code

xiaobigmeow commented 2 months ago
df = pd.DataFrame(
    {
        "A": 1.0,
        "B": pd.Timestamp("20130102"),
        "C": pd.Series(1, index=list(range(4)), dtype="float32"),
        "D": pd.Categorical(["test", "train", "test", "train"]),
        "E": "foo",
    }
)

datagrid = ipydatagrid.DataGrid(df)
datagrid
andrewgross commented 1 month ago

I ran in to issues on Databricks with 1.3.0+ as well. Rendering any pandas dataframe gives:

Error displaying widget: e.data[i].value is undefined

Up through 1.2.1 worked fine.

1.3.0:

image

1.2.1

image