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

sort a 1 row DataFrame with object panics #19925

Closed
2 tasks done
gab23r opened this issue Nov 22, 2024 · 1 comment · Fixed by #19940
Closed
2 tasks done

sort a 1 row DataFrame with object panics #19925

gab23r opened this issue Nov 22, 2024 · 1 comment · Fixed by #19940
Assignees
Labels
accepted Ready for implementation bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars

Comments

@gab23r
Copy link
Contributor

gab23r commented Nov 22, 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({"a": [0], "obj": [object()]}).sort("a")
# thread '<unnamed>' panicked at crates/polars-core/src/scalar/mod.rs:55:92:
# called `Result::unwrap()` on an `Err` value: SchemaMismatch(ErrString("expected object"))


pl.DataFrame({"a": [0, 1], "obj": [object(), object()]}).sort("a") # works 

Log output

No response

Issue description

Panic when filtering a 1 row DataFrame containing objects, even if filtering on non-object column

Expected behavior

No panics, the dataframe stays the same

Installed versions

--------Version info---------
Polars:              1.14.0
Index type:          UInt32
Platform:            macOS-14.1.1-x86_64-i386-64bit
Python:              3.12.5 (main, Aug 14 2024, 05:07:52) [Clang 18.1.8 ]
LTS CPU:             False

----Optional dependencies----
adbc_driver_manager  <not installed>
altair               5.4.1
boto3                <not installed>
cloudpickle          <not installed>
connectorx           <not installed>
deltalake            <not installed>
fastexcel            0.12.0
fsspec               <not installed>
gevent               <not installed>
google.auth          <not installed>
great_tables         <not installed>
matplotlib           3.9.2
nest_asyncio         1.6.0
numpy                1.26.0
openpyxl             3.1.2
pandas               2.1.1
pyarrow              17.0.0
pydantic             2.8.2
pyiceberg            <not installed>
sqlalchemy           <not installed>
torch                <not installed>
xlsx2csv             0.8.2
xlsxwriter           <not installed>
@gab23r gab23r added bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars labels Nov 22, 2024
@gab23r
Copy link
Contributor Author

gab23r commented Nov 22, 2024

I hit this bug in another way. This this another MRE, if it helps:

df = pl.DataFrame({"a": 1, "obj": [object()]})
df.join(df, on = "a")

@ritchie46 ritchie46 self-assigned this Nov 23, 2024
@c-peters c-peters added the accepted Ready for implementation label Nov 25, 2024
@c-peters c-peters added this to Backlog Nov 25, 2024
@c-peters c-peters moved this to Done in Backlog Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Ready for implementation bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants