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

cse_expr PanicException on main #21115

Closed
2 tasks done
cmdlineluser opened this issue Feb 6, 2025 · 1 comment · Fixed by #21135
Closed
2 tasks done

cse_expr PanicException on main #21115

cmdlineluser opened this issue Feb 6, 2025 · 1 comment · Fixed by #21135
Assignees
Labels
A-optimizer Area: plan optimization accepted Ready for implementation bug Something isn't working P-high Priority: high 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

lf = pl.LazyFrame({'x': 1, 'y': 5})

lf.with_columns(
    pl.all().exp() + pl.min_horizontal(pl.all().exp())
).collect()
# PanicException: called `Option::unwrap()` on a `None` value

Log output

thread '<unnamed>' panicked at crates/polars-plan/src/plans/optimizer/cse/cse_expr.rs:775:72:
called `Option::unwrap()` on a `None` value

Issue description

The query runs in 1.21.0 but currently panics on main for me.

.explain() also panics.

It runs with comm_subexpr_elim disabled.

lf.with_columns(
    pl.all().exp() + pl.min_horizontal(pl.all().exp())
).collect(comm_subexpr_elim=False)

# shape: (1, 2)
# ┌──────────┬────────────┐
# │ x        ┆ y          │
# │ ---      ┆ ---        │
# │ f64      ┆ f64        │
# ╞══════════╪════════════╡
# │ 5.436564 ┆ 151.131441 │
# └──────────┴────────────┘

Expected behavior

No panic.

Installed versions

main

@cmdlineluser cmdlineluser added bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars labels Feb 6, 2025
@coastalwhite
Copy link
Collaborator

Pretty sure it is 6a3fc59. @ritchie46 can you have a look?

@coastalwhite coastalwhite added P-high Priority: high A-optimizer Area: plan optimization and removed needs triage Awaiting prioritization by a maintainer labels Feb 6, 2025
@ritchie46 ritchie46 self-assigned this Feb 7, 2025
@c-peters c-peters added the accepted Ready for implementation label Feb 10, 2025
@c-peters c-peters added this to Backlog Feb 10, 2025
@c-peters c-peters moved this to Done in Backlog Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-optimizer Area: plan optimization accepted Ready for implementation bug Something isn't working P-high Priority: high python Related to Python Polars
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants