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

arr.max() paniced in the latest release #15646

Closed
2 tasks done
eitsupi opened this issue Apr 14, 2024 · 2 comments · Fixed by #15654
Closed
2 tasks done

arr.max() paniced in the latest release #15646

eitsupi opened this issue Apr 14, 2024 · 2 comments · Fixed by #15654
Assignees
Labels
A-dtype-list/array Area: list/array data type A-panic Area: code that results in panic exceptions bug Something isn't working P-medium Priority: medium rust Related to Rust Polars

Comments

@eitsupi
Copy link
Contributor

eitsupi commented Apr 14, 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
pl.DataFrame({"foo": [[1, None], [1, 2], [None, None]]}).select(pl.col("foo").list.to_array(2).arr.max())

Log output

thread 'python3' panicked at crates/polars-arrow/src/bitmap/aligned.rs:115:48:
mid > len
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/rstudio/.local/lib/python3.10/site-packages/polars/dataframe/frame.py", line 7697, in select
    return self.lazy().select(*exprs, **named_exprs).collect(_eager=True)
  File "/home/rstudio/.local/lib/python3.10/site-packages/polars/lazyframe/frame.py", line 1708, in collect
    return wrap_df(ldf.collect())
pyo3_runtime.PanicException: mid > len

Issue description

This is strictly a bug in Rust, I noticed the panic in pola-rs/r-polars#1034 after updating to Rust Polars 0.39.0.

Expected behavior

Should not panicked.

Installed versions

--------Version info---------
Polars:               0.20.20
Index type:           UInt32
Platform:             Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.35
Python:               3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]

----Optional dependencies----
adbc_driver_manager:  <not installed>
cloudpickle:          <not installed>
connectorx:           <not installed>
deltalake:            <not installed>
fastexcel:            <not installed>
fsspec:               <not installed>
gevent:               <not installed>
hvplot:               <not installed>
matplotlib:           <not installed>
nest_asyncio:         <not installed>
numpy:                1.26.3
openpyxl:             <not installed>
pandas:               2.1.4
pyarrow:              15.0.0
pydantic:             <not installed>
pyiceberg:            <not installed>
pyxlsb:               <not installed>
sqlalchemy:           <not installed>
xlsx2csv:             <not installed>
xlsxwriter:           <not installed>
@eitsupi eitsupi added bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars labels Apr 14, 2024
@etiennebacher
Copy link

Looks similar to #14359

@reswqa reswqa added A-dtype-list/array Area: list/array data type A-panic Area: code that results in panic exceptions P-medium Priority: medium and removed needs triage Awaiting prioritization by a maintainer labels Apr 15, 2024
@reswqa reswqa self-assigned this Apr 15, 2024
@reswqa
Copy link
Collaborator

reswqa commented Apr 15, 2024

Thanks for raising it! This helped us find a "unsafe" unsafe call 🤣

@reswqa reswqa added rust Related to Rust Polars and removed python Related to Python Polars labels Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-dtype-list/array Area: list/array data type A-panic Area: code that results in panic exceptions bug Something isn't working P-medium Priority: medium rust Related to Rust Polars
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants