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

Merge sorted not implemented for structs #20986

Closed
2 tasks done
coastalwhite opened this issue Jan 29, 2025 · 4 comments · Fixed by #21205
Closed
2 tasks done

Merge sorted not implemented for structs #20986

coastalwhite opened this issue Jan 29, 2025 · 4 comments · Fixed by #21205
Labels
bug Something isn't working good first issue Good for newcomers needs triage Awaiting prioritization by a maintainer python Related to Python Polars

Comments

@coastalwhite
Copy link
Collaborator

coastalwhite commented Jan 29, 2025

Checks

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest version of Polars.

Reproducible example

import polars as pl
from polars.testing import assert_series_equal

s = pl.Series('a', [{ 'x': 1 }], pl.Struct({ 'x': pl.Int32 }))

df = pl.DataFrame([s.sort()])

merge_sorted = df.lazy().merge_sorted(df.lazy(), 'a').collect().get_column('a')

Log output

thread '<unnamed>' panicked at crates/polars-ops/src/frame/join/merge_sorted.rs:152:13:
not implemented for dtype Struct([Field { name: "x", dtype: Int64 }])
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Traceback (most recent call last):
  File "/home/johndoe/Projects/polars/bug.py", line 8, in <module>
    merge_sorted = df.lazy().merge_sorted(df.lazy(), 'a').collect().get_column('a')
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/johndoe/Projects/polars/py-polars/polars/lazyframe/frame.py", line 2056, in collect
    return wrap_df(ldf.collect(callback))
                   ^^^^^^^^^^^^^^^^^^^^^
pyo3_runtime.PanicException: not implemented for dtype Struct([Field { name: "x", dtype: Int64 }])

Issue description

Expected behavior

Installed versions

Replace this line with the output of pl.show_versions(). Leave the backticks in place.
@coastalwhite coastalwhite added bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars labels Jan 29, 2025
@coastalwhite
Copy link
Collaborator Author

This should probably be implemented by converting to the row encoding then doing the merge sorted and then decoding from there.

@coastalwhite coastalwhite added the good first issue Good for newcomers label Jan 29, 2025
@lukemanley
Copy link
Contributor

xref: #13485

@aditya0yadav
Copy link

aditya0yadav commented Feb 9, 2025

hi lukemanley coastalwhite
i can work on this
i have the required skill for this

@JakubValtar
Copy link
Contributor

Hey @aditya0yadav, are you working on this?

I implemented it yesterday and I was just preparing to send a PR, but wanted to check with you first, since I forgot to claim it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers needs triage Awaiting prioritization by a maintainer python Related to Python Polars
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants