Skip to content

New dataframe transform: Polars Native Expand Dict Transformation #4583

@adarshchbs

Description

@adarshchbs

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:
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions