marimo
marimo copied to clipboard
New dataframe transform: Polars Native Expand Dict Transformation
Description
I'm proposing to extend Expand Dict dataframe transformation that implements Polars' column unnest functionality. Currently, marimo has an Expand Dict feature, but it fails when a column contains null values, throwing the error: 'NoneType' object cannot be converted to 'PyDict'.
Suggested solution
The native Polars method df.unnest("column_name") handles null values gracefully without failing. This new transformation would leverage the Polars unnest method directly, making it more robust when working with dictionaries that contain null values.
It would allow users to flatten nested dictionaries into separate columns without having to pre-process the data to handle null values.
I am willing to submit a PR to implement this functionality if desired.
Alternative
No response
Additional context
Error message:
@adarshchbs - this would be a great addition if you are open to submitting the PR. We are here to help (best to communicate via Discord)