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

Zero-sized Array caused panic exception #18921

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

Zero-sized Array caused panic exception #18921

coastalwhite opened this issue Sep 25, 2024 · 0 comments · Fixed by #18940
Assignees
Labels
A-panic Area: code that results in panic exceptions 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
pl.Series('foo', [None], pl.Array(pl.Null, 0))

Log output

No response

Issue description

Attempting to create a zero-width array causes a panic

Expected behavior

No 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 A-panic Area: code that results in panic exceptions labels Sep 25, 2024
@coastalwhite coastalwhite self-assigned this Sep 25, 2024
coastalwhite added a commit to coastalwhite/polars that referenced this issue Sep 25, 2024
This not only affects the example given in the issue but also just provides a generally better error.

Fixes pola-rs#18921.
coastalwhite added a commit to coastalwhite/polars that referenced this issue Sep 26, 2024
This PR properly implements `polars.Array(..., 0)`. This does make a few
fundamental changes to how `FixedSizeListArray` works internally. Mainly, it
now keeps a `length` field that actually determines the length instead of
relying the `values.len() / size`.

Fixes pola-rs#18921, pola-rs#16878.
@c-peters c-peters added the accepted Ready for implementation label Sep 29, 2024
@c-peters c-peters moved this to Done in Backlog Sep 29, 2024
@c-peters c-peters added this to Backlog Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-panic Area: code that results in panic exceptions 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
2 participants