Skip to content

scan_parquet and filter(pl.lit(True)) panic error #22618

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

Open
2 tasks done
zexumath opened this issue May 5, 2025 · 0 comments
Open
2 tasks done

scan_parquet and filter(pl.lit(True)) panic error #22618

zexumath opened this issue May 5, 2025 · 0 comments
Labels
bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars

Comments

@zexumath
Copy link

zexumath commented May 5, 2025

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

df_32769 = pl.DataFrame(
    {
        "test_data": "a",
        "index": list(range(32769)),
        "partition": [x // 100 for x in range(32769)],
    }
)
df_32769.write_parquet(
    "path/to/save/",
    pyarrow_options={"partition_cols": ["partition"]},
    use_pyarrow=True,
)
pl.scan_parquet(
    "path/to/save/"
).filter(pl.lit(True)).collect()

Log output

thread 'tokio-runtime-worker' panicked at /home/runner/work/polars/polars/crates/polars-arrow/src/bitmap/immutable.rs:255:9:
assertion failed: offset + length <= self.length
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'tokio-runtime-worker' panicked at crates/polars-stream/src/nodes/io_sources/parquet/init.rs:331:33:
called `Result::unwrap()` on an `Err` value: JoinError::Panic(Id(1788), "assertion failed: offset + length <= self.length", ...)

thread 'async-executor-71' panicked at crates/polars-stream/src/nodes/io_sources/parquet/mod.rs:272:80:
called `Result::unwrap()` on an `Err` value: JoinError::Panic(Id(1791), "called `Result::unwrap()` on an `Err` value: JoinError::Panic(Id(1788), \"assertion failed: offset + length <= self.length\", ...)", ...)

Issue description

When reading parquet files using pl.scan_parquet and filter(pl.lit(True)), and PanicException is thrown. Issue would go away if

  • one file is read.
  • total number of rows <=32768 with same number of partitions
  • files are written with use_pyarrow=False and partition_col=.
    - filter(True) is called rather than filter(pl.lit(True))

Expected behavior

no PanicException is expected

Installed versions

--------Version info---------
Polars:              1.28.1
Index type:          UInt32
Platform:            Linux-4.18.0-553.34.1.el8_10.x86_64-x86_64-with-glibc2.28
Python:              3.11.8 (main, Feb 26 2024, 21:39:34) [GCC 11.2.0]
LTS CPU:             False

----Optional dependencies----
Azure CLI            <not installed>
adbc_driver_manager  1.2.0
altair               5.4.1
azure.identity       <not installed>
boto3                <not installed>
cloudpickle          3.0.0
connectorx           0.3.3
deltalake            0.19.2
fastexcel            0.11.6
fsspec               2024.6.1
gevent               24.2.1
google.auth          <not installed>
great_tables         0.11.0
matplotlib           3.10.0
numpy                1.26.4
openpyxl             3.1.5
pandas               2.0.3
polars_cloud         <not installed>
pyarrow              17.0.0
pydantic             2.11.3
pyiceberg            0.7.1
sqlalchemy           2.0.34
torch                <not installed>
xlsx2csv             0.8.3
xlsxwriter           3.2.0```

</details>
@zexumath zexumath added bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars labels May 5, 2025
@nameexhaustion nameexhaustion changed the title scan_parquet and filter(pl.lit(True)) error scan_parquet and filter(pl.lit(True)) panic error May 5, 2025
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

No branches or pull requests

1 participant