ion-python icon indicating copy to clipboard operation
ion-python copied to clipboard

How to Convert IonPyDict into Native Python dict?

Open MacHu-GWU opened this issue 1 year ago • 1 comments

IonPyDict is the returned type of loads() method. However, a lot of data library like pandas, polars works with native python library only, is there a convenient way to convert all value of IonPyDict into native Python value?

MacHu-GWU avatar Aug 02 '24 18:08 MacHu-GWU

For context, this appears to be a follow-up from https://github.com/amazon-ion/ion-python/issues/362

My suggestion there was to use the IonPyValueModel.STRUCT_AS_STD_DICT which should result in Ion Structs deserializing to IonPyStdDict objects (which inherit from dict).

If that solution doesn't work for you, please help me understand why not and what you need instead.

rmarrowstone avatar Aug 12 '24 20:08 rmarrowstone