ipydatagrid icon indicating copy to clipboard operation
ipydatagrid copied to clipboard

Dictionary Values are Not Displayed correctly

Open JohnOmernik opened this issue 2 years ago • 2 comments

Describe the bug When a Dictionary object is in a column of a Data frame, or even in a list item of a dataframe, it is displayed as [object Object] instead of a more intuitive "use str repr of dictionary".

To Reproduce Steps to reproduce the behavior:

  1. mydf = pd.DataFrame([{'dict_field':{'hi':'ya'}}, {'dict_field':{'hi':'yo'}}])
  2. Render this in ipydataframe
  3. Observe [object Object] rather than {'hi': 'ya'}
  4. ????
  5. Profit (Sorry, couldn't help myself)

Expected behavior Like lists, (which are rendered correctly unless they contain dictionaries), ipydatagrid should use a str repr of the dictionary object. I am not sure how that will affect performance, but if performance is a major concern, perhaps make a flag that defaults to False that can override and force that str repr to be displayed

Environment (please complete the following information):

  • Jupyter Lab running on Windows in Chrome

JohnOmernik avatar Dec 03 '22 20:12 JohnOmernik