Describe the bug
It's me again with some datetime bug. If there is NA-data in a datetime column ipydatagrid crashes.
To Reproduce
import pandas as pd
from ipydatagrid import DataGrid
df = pd.DataFrame({'A': ['2024-01-01', pd.NA]}, dtype='datetime64[ns]')
df
renders as HTML-table like this:
but if I try to put that df in a Datagrid:
DataGrid(df)
I get this:
[Open Browser Console for more detailed log - Double click to close this message]
Model class 'DataGridModel' from module 'ipydatagrid' is loaded but can not be instantiated
deserialize@http://localhost:8888/lab/extensions/ipydatagrid/static/787.b52e0074e2cbca59f4b7.js?v=b52e0074e2cbca59f4b7:1:59997
_deserialize_state@http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/647.e39f528c8fee8adb9110.js?v=e39f528c8fee8adb9110:1:12381
Expected behavior
To be able to render NaT-datetime-values
Workaround
I have a workaround for anyone who may also have this issue until it is solved:
df['A'] = df['A'].astype(object).fillna('')
Environment (please complete the following information):
Describe the bug It's me again with some datetime bug. If there is NA-data in a datetime column ipydatagrid crashes.
To Reproduce
renders as HTML-table like this: but if I try to put that
df
in aDatagrid
:I get this:
Expected behavior To be able to render
NaT
-datetime-valuesWorkaround I have a workaround for anyone who may also have this issue until it is solved:
Environment (please complete the following information):