ipydatagrid icon indicating copy to clipboard operation
ipydatagrid copied to clipboard

Grid does not appear and "Error: Could not create a model." logged in console in latest version

Open kerrick-js opened this issue 1 year ago • 1 comments
trafficstars

Summary

When I try to display a DataGrid with ipydatagrid 1.3.2, the grid doesn't render, and I see "Error: Could not create a model." logged in the Javascript console. This doesn't happen with ipydatagrid 1.2.1.

To reproduce

Run this code:

import pandas as pd
from ipydatagrid import DataGrid
 
df = pd.DataFrame(
    {
        "stock": ["AAPL", "MSFT"],
        "price": [224.0, 419.0],
    },
)
 
DataGrid(df)

Expected result

A grid appears

Actual result

No grid appears

I also see this message in the Javascript console:

Error: Could not create a model.
    at utils.js:119:27
[...]

along with a few of these errors:

kernel.js:1010 Couldn't process kernel message TypeError: e is not iterable
    at Module.g (index.js?v=20240819093341:2:40230)
    at d._updatePrimaryKeyMap (index.js?v=20240819093341:2:928472)
[...]

System info

ipydatagrid 1.3.2 Jupyter notebook classic version 6.4.13 Python 3.10.13 IPython 8.26.0 Chrome Version 127.0.6533.119 (Official Build) (64-bit)

Notes

  • ipydatagrid 1.2.1 works; I don't see this bug.
  • I see two of the TypeError: e is not iterable errors with ipydatagrid 1.2.1, but there are 15 of them with ipydatagrid 1.3.2.

kerrick-js avatar Aug 19 '24 14:08 kerrick-js