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

fix: accidental panic if predicate selects no files #12575

Merged
merged 3 commits into from
Nov 20, 2023
Merged

fix: accidental panic if predicate selects no files #12575

merged 3 commits into from
Nov 20, 2023

Conversation

ritchie46
Copy link
Member

fixes #12570

@ritchie46 ritchie46 requested a review from orlp as a code owner November 19, 2023 18:55
@github-actions github-actions bot added fix Bug fix python Related to Python Polars rust Related to Rust Polars labels Nov 19, 2023
Copy link

Nov 20, 2023

FWIW, I tried the build in panic branch and i still see an error. Its different from before:

>>> lf = pl.scan_parquet('/home/ddutt/work/suzieq/tests/data/parquet/inventory/**/*.parquet').filter(pl.col.namespace=="foo").select(['namespace', 'hostname', 'timestamp']).collect()
thread '<unnamed>' panicked at /home/ddutt/work/polars/crates/polars-core/src/utils/mod.rs:576:34:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ddutt/work/polars/py-polars/polars/utils/deprecation.py", line 100, in wrapper
    return function(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ddutt/work/polars/py-polars/polars/lazyframe/frame.py", line 1788, in collect
    return wrap_df(ldf.collect())
                   ^^^^^^^^^^^^^
pyo3_runtime.PanicException: called `Option::unwrap()` on a `None` value

@ritchie46 ritchie46 merged commit 402e280 into main Nov 20, 2023
25 checks passed
@ritchie46 ritchie46 deleted the panic branch November 20, 2023 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix python Related to Python Polars rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PanicException: index out of bounds: the len is 0 but the index is 0 when filter doesn't select any rows
2 participants