polars icon indicating copy to clipboard operation
polars copied to clipboard

`pl.element` inside `list.eval` causes ColumnNotFoundError

Open cmdlineluser opened this issue 4 months ago • 0 comments

Checks

  • [X] I have checked that this issue has not already been reported.
  • [X] I have confirmed this bug exists on the latest version of Polars.

Reproducible example

import polars as pl

s = pl.Series([[1, 2]])
s.list.eval(pl.when(False).then(1).otherwise(pl.element().hash()))
# ColumnNotFoundError: 

Log output

No response

Issue description

On main it produces a ColumnNotFoundError, it runs on 1.9.0.

From what I can gather, it is a side effect of: https://github.com/pola-rs/polars/pull/19195

The underlying problem is likely relevant to:

https://github.com/pola-rs/polars/pull/18993#discussion_r1780705514

we really need to replace that element => col("") hack with a proper Expr::Element type and something that can run it.

Expected behavior

No error.

Installed versions

main

cmdlineluser avatar Oct 19 '24 11:10 cmdlineluser