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 requesting row encoding after clearing string cache #20364

Open
2 tasks done
coastalwhite opened this issue Dec 19, 2024 · 0 comments · May be fixed by #20389
Open
2 tasks done

Panic when requesting row encoding after clearing string cache #20364

coastalwhite opened this issue Dec 19, 2024 · 0 comments · May be fixed by #20389
Labels
bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars

Comments

@coastalwhite
Copy link
Collaborator

coastalwhite commented Dec 19, 2024

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
with pl.StringCache():
    s = pl.Series('s', ['a'], pl.Categorical(ordering = 'lexical'))
    
s.to_frame()._row_encode([(False, False, False)])

Log output

thread '<unnamed>' panicked at crates/polars-core/src/chunked_array/ops/row_encode.rs:122:29:
assertion failed: payloads.len() >= num_known_categories as usize
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Issue description

Panic occurs when it shouldn't, although I am not really sure how to handle this situation since the categories are no longer available.

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 labels Dec 19, 2024
coastalwhite added a commit to coastalwhite/polars that referenced this issue Dec 19, 2024
coastalwhite added a commit to coastalwhite/polars that referenced this issue Dec 19, 2024
@coastalwhite coastalwhite changed the title Panic when sorting lexical categoricals after clearing string cache Panic when requesting row encoding after clearing string cache Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 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.

1 participant