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

Panic when comparing Arrays #18938

Closed
2 tasks done
coastalwhite opened this issue Sep 26, 2024 · 0 comments · Fixed by #18963
Closed
2 tasks done

Panic when comparing Arrays #18938

coastalwhite opened this issue Sep 26, 2024 · 0 comments · Fixed by #18963
Assignees
Labels
accepted Ready for implementation bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars

Comments

@coastalwhite
Copy link
Collaborator

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

a = pl.Series('a', [[1]], pl.Array(pl.Int8, 1))
b = pl.Series('b', [[1]], pl.Array(pl.Int8, 1))

c = a < b

Log output

thread '<unnamed>' panicked at crates/polars-core/src/chunked_array/comparison/mod.rs:848:9:
not implemented

Issue description

Panic in the dispatching.

Expected behavior

Should not panic

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 python Related to Python Polars needs triage Awaiting prioritization by a maintainer labels Sep 26, 2024
coastalwhite added a commit to coastalwhite/polars that referenced this issue Sep 27, 2024
Divide the `ChunkCompare` trait into two traits `ChunkCompareEq` and
`ChunkCompareIneq`, which allows us to statistically verify that there are no
calls to the inequality methods when these are not available (e.g. for `List`,
`Array` and `Struct`). This makes error handling a lot better as well.

For example, the following was a panic exception before.

```python
import polars as pl

a = pl.Series('a', [[1]], pl.Array(pl.Int8, 1))
b = pl.Series('b', [[1]], pl.Array(pl.Int8, 1))

c = a < b
```

Now, it returns:

```
polars.exceptions.InvalidOperationError: cannot perform '<' comparison between series 'a' of dtype: array[i8, 1] and series 'b' of dtype: array[i8, 1]
```

Fixes pola-rs#18938.
@c-peters c-peters added the accepted Ready for implementation label Sep 29, 2024
@c-peters c-peters added this to Backlog Sep 29, 2024
@c-peters c-peters moved this to Done in Backlog Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Ready for implementation bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants