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

pl.all().filter PanicException #18733

Open
2 tasks done
cmdlineluser opened this issue Sep 13, 2024 · 0 comments · May be fixed by #18993
Open
2 tasks done

pl.all().filter PanicException #18733

cmdlineluser opened this issue Sep 13, 2024 · 0 comments · May be fixed by #18993
Assignees
Labels
A-panic Area: code that results in panic exceptions bug Something isn't working P-low Priority: low python Related to Python Polars

Comments

@cmdlineluser
Copy link
Contributor

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 = pl.DataFrame({"foo": [1], "bar": [2]})

df.select(pl.all().filter(foo = 1))
# thread '<unnamed>' panicked at /Users/runner/work/polars/polars/crates/polars-plan/src/dsl/mod.rs:1145:13:
# filter '*' not allowed, use LazyFrame::filter
# PanicException: filter '*' not allowed, use LazyFrame::filter

Log output

No response

Issue description

Explicitly naming all the columns works.

df.select(pl.col("foo", "bar").filter(foo = 1))
# shape: (1, 2)
# ┌─────┬─────┐
# │ foo ┆ bar │
# │ --- ┆ --- │
# │ i64 ┆ i64 │
# ╞═════╪═════╡
# │ 1   ┆ 2   │
# └─────┴─────┘

Expected behavior

Should be allowed?

If not, the panic can be replaced with the appropriate error.

Installed versions

--------Version info---------
Polars:               1.7.1
Index type:           UInt32
Platform:             macOS-13.6.1-arm64-arm-64bit
Python:               3.12.2 (main, Feb  6 2024, 20:19:44) [Clang 15.0.0 (clang-1500.1.0.2.5)]

----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>
great_tables:         <not installed>
hvplot:               <not installed>
matplotlib:           <not installed>
nest_asyncio:         <not installed>
numpy:                1.26.4
openpyxl:             <not installed>
pandas:               2.2.1
pyarrow:              15.0.2
pydantic:             <not installed>
pyiceberg:            <not installed>
sqlalchemy:           <not installed>
torch:                <not installed>
xlsx2csv:             <not installed>
xlsxwriter:           <not installed>
@cmdlineluser cmdlineluser added bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars labels Sep 13, 2024
@ritchie46 ritchie46 added A-panic Area: code that results in panic exceptions P-medium Priority: medium and removed needs triage Awaiting prioritization by a maintainer labels Sep 13, 2024
@nameexhaustion nameexhaustion self-assigned this Sep 26, 2024
@nameexhaustion nameexhaustion added P-low Priority: low and removed P-medium Priority: medium labels Sep 26, 2024
@nameexhaustion nameexhaustion linked a pull request Sep 28, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-panic Area: code that results in panic exceptions bug Something isn't working P-low Priority: low python Related to Python Polars
Projects
Status: Ready
Development

Successfully merging a pull request may close this issue.

3 participants