[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
df = pl.DataFrame({"a": [1, 8, 3]})
df.with_columns(pl.min_horizontal(5,"a"), # creates new column 'literal'
pl.min_horizontal("a",5), # keeps results in column 'a'
)
Log output
-
Issue description
If a number comes first in the min_horizontal arguments, then polars creates a new field called 'literal', but if an existing field comes first, then it retains the column name.
Expected behavior
Should not create new ('literal') field if only one column and one or more literals are present anywhere in the attributes.
This applies to max_horizontal, as well.
Checks
Reproducible example
Log output
Issue description
If a number comes first in the min_horizontal arguments, then polars creates a new field called 'literal', but if an existing field comes first, then it retains the column name.
Expected behavior
Should not create new ('literal') field if only one column and one or more literals are present anywhere in the attributes. This applies to max_horizontal, as well.
Installed versions