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

Implementation: add support for kwargs and/or hash as arg to Polars.struct #73

Closed
DeflateAwning opened this issue Jun 19, 2024 · 2 comments

Comments

@DeflateAwning
Copy link

DeflateAwning commented Jun 19, 2024

I think the following syntax should work to create named fields in a struct in an Expression.

df = df.select(
    Polars::col('id'),
    test_struct: Polars.struct({
        entity: Polars::col("raw_upper_formation_name"),
        boundary: Polars::col("upper_boundary_type"),
      }),
)

I think it should work with OR without curly braces around the Polars.struct arg. I think it should definitely work at least one way like that.

@ankane ankane closed this as completed in 77dcc6b Jun 19, 2024
@ankane
Copy link
Owner

ankane commented Jun 19, 2024

Hi @DeflateAwning, updated in the commit above.

@DeflateAwning
Copy link
Author

No way, thanks so much!

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

No branches or pull requests

2 participants