ipydatagrid icon indicating copy to clipboard operation
ipydatagrid copied to clipboard

datetime and Decimal objects get "Can't clean for JSON" message

Open JohnOmernik opened this issue 3 years ago • 1 comments

Describe the bug Similar to the pd.NA bug #257 datatypes like datetime and Decimal objects produce and error on render. Perhaps we should just to do the str repr?

To Reproduce

import datetime
import ipydatagrid
from decimal import Decimal
import pandas as pd
mydf = pd.DataFrame({"text_col": ['a', 'b', pd.NA, Decimal(0.00), datetime.date(2022, 8, 19)]})

mydg = ipydatagrid.DataGrid(mydf)


**Expected behavior**
Ideally if there is a type of data it doesn't understand, force it to string and show it as such (or at least an option to do that)


JohnOmernik avatar Aug 19 '22 16:08 JohnOmernik

Hello @JohnOmernik and welcome to the ipydatagrid community! Thanks for reporting the error - I will get that fixed.

ibdafna avatar Aug 19 '22 19:08 ibdafna