Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert IonPyDict to regular Python dict, so that it is compatible with dataframe library like pandas polars #362

Closed
MacHu-GWU opened this issue Aug 1, 2024 · 1 comment

Comments

@MacHu-GWU
Copy link

My company are using DynamoDB heavily and use DynamoDB export to convert a DynamoDB table into a bunch of parquet file. We want to parse the exported ion file and then convert it to polars dataframe. However, polars dataframe doesn't recognize IonPyDict.

@rmarrowstone
Copy link
Contributor

As of version 0.12.0 you can control that using IonPyValueModel.STRUCT_AS_STD_DICT.

See https://github.com/amazon-ion/ion-python/blob/master/amazon/ion/simpleion.py#L208

For example:

load(f, single_value=False, parse_eagerly=False,
                           value_model=IonPyValueModel.STRUCT_AS_STD_DICT)

Feel free to reopen if this doesn't meet your needs or somehow doesn't work for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants