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

Out of core query panics with "expected BinaryOffset, got binary" #14430

Closed
2 tasks done
stinodego opened this issue Feb 12, 2024 · 1 comment · Fixed by #14464
Closed
2 tasks done

Out of core query panics with "expected BinaryOffset, got binary" #14430

stinodego opened this issue Feb 12, 2024 · 1 comment · Fixed by #14464
Assignees
Labels
bug Something isn't working P-high Priority: high python Related to Python Polars test Related to the test suite

Comments

@stinodego
Copy link
Member

stinodego commented Feb 12, 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 os
from pathlib import Path

import polars as pl

# Run this script from the `py-polars` folder, or otherwise make sure it points to that folder
io_files_path = Path() / "tests" / "unit" / "io" / "files"
df = pl.read_csv(io_files_path / "foods*.csv")

os.environ["POLARS_FORCE_OOC"] = "1"
os.environ["POLARS_STREAMING_GROUPBY_SPILL_SIZE"] = "256"

# this creates 10M rows
q = df.lazy()
q = q.join(q, how="cross").select(df.columns).head(10_000)

# uses out-of-core unique
df1 = q.join(q.head(1000), how="cross").unique().collect(streaming=True)
print(df1)

Log output

run UdfExec
RUN STREAMING PIPELINE
df -> cross_join_sink
RefCell { value: [df -> placeholder -> slice_sink -> fast_projection -> cross_join_sink, df -> cross_join_sink, df -> placeholder -> slice_sink -> fast_projection -> slice_sink -> placeholder -> re-project-sink -> ordered_sink] }
OOC group_by started
Temporary directory path in use: /tmp
Temporary directory path in use: /tmp
OOC group_by started
OOC group_by started
OOC group_by started
OOC group_by started
OOC group_by started
OOC group_by started
OOC group_by started
OOC group_by started
OOC group_by started
OOC group_by started
OOC group_by started
process partition 0 during generic-group_by-source
thread '<unnamed>' panicked at crates/polars-pipe/src/executors/sinks/group_by/generic/mod.rs:97:44:
called `Result::unwrap()` on an `Err` value: SchemaMismatch(ErrString("invalid series dtype: expected `BinaryOffset`, got `binary`"))
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Traceback (most recent call last):
  File "/home/stijn/code/polars/py-polars/repro.py", line 18, in <module>
    df1 = q.join(q.head(1000), how="cross").unique().collect(streaming=True)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stijn/code/polars/py-polars/polars/lazyframe/frame.py", line 1935, in collect
    return wrap_df(ldf.collect())
                   ^^^^^^^^^^^^^
pyo3_runtime.PanicException: called `Result::unwrap()` on an `Err` value: SchemaMismatch(ErrString("invalid series dtype: expected `BinaryOffset`, got `binary`"))

Issue description

There is actually a test for this in our test suite. It runs fine when you run it together with other tests, but fails like the script above when you run it independently:

pytest tests/unit/streaming/test_streaming_unique.py::test_streaming_out_of_core_unique -m ''

Expected behavior

It should work.

Installed versions

main

@stinodego stinodego added bug Something isn't working python Related to Python Polars needs triage Awaiting prioritization by a maintainer P-high Priority: high test Related to the test suite and removed needs triage Awaiting prioritization by a maintainer labels Feb 12, 2024
@stinodego
Copy link
Member Author

stinodego commented Feb 12, 2024

I marked this as high priority as I believe this is related to the recent string of CI failures detailed here: #13526

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P-high Priority: high python Related to Python Polars test Related to the test suite
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants