polars icon indicating copy to clipboard operation
polars copied to clipboard

`pl.int_range().name.suffix` ComputeError

Open cmdlineluser opened this issue 1 year ago • 2 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

pl.select(pl.int_range(1, 5).alias("int").name.suffix("_moo"))
# PanicException: called `Result::unwrap()` on an `Err` value: 
# ComputeError(ErrString("unable to find a single leaf column in expr 1.int_range([5]).alias(\"int\")"))

Log output

No response

Issue description

Trying to prefix/suffix int_range raises an exception.

It happens without alias() - I added alias() to see if it worked around the issue.

Expected behavior

No exception.

Installed versions

--------Version info---------
Polars:               0.20.5
Index type:           UInt32
Platform:             macOS-13.6.1-arm64-arm-64bit
Python:               3.11.6 (main, Nov  2 2023, 04:39:43) [Clang 14.0.3 (clang-1403.0.22.14.1)]

----Optional dependencies----
adbc_driver_manager:  <not installed>
cloudpickle:          <not installed>
connectorx:           0.3.2
deltalake:            <not installed>
fsspec:               2023.6.0
gevent:               <not installed>
hvplot:               <not installed>
matplotlib:           3.8.2
numpy:                1.26.2
openpyxl:             <not installed>
pandas:               2.0.3
pyarrow:              12.0.1
pydantic:             2.5.2
pyiceberg:            <not installed>
pyxlsb:               <not installed>
sqlalchemy:           <not installed>
xlsx2csv:             0.8.1
xlsxwriter:           3.1.9

cmdlineluser avatar Jan 18 '24 19:01 cmdlineluser