You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of Polars.
Issue description
pl.min([str1,str2,str3,...]) and pl.max([str1,str2,str3,...]) have their own implementation which cannot handle a wildcard as it resolves the expression immediately.
This issue is fixed in this PR #5511 be using the pl.sum([...]) impl pattern on pl.min and pl.max. However someone should just check if this vector allocation is performance-wise ok.
Reproducible example
importpolarsasplfruits_cars=pl.DataFrame({
"A": [1, 2, 3, 4, 5],
"fruits": ["banana", "banana", "apple", "apple", "banana"],
"B": [5, 4, 3, 2, 1],
"cars": ["beetle", "audi", "beetle", "beetle", "beetle"],
})
#try use wild cardfruits_cars.select([pl.col(pl.datatypes.Int64)]).select(pl.min(["*"]))
#hmm it just returned all columns untouchedshape: (5, 2)
┌─────┬─────┐
│ A ┆ B │
│ --- ┆ --- │
│ i64 ┆ i64 │
╞═════╪═════╡
│ 1 ┆ 5 │
├╌╌╌╌╌┼╌╌╌╌╌┤
│ 2 ┆ 4 │
├╌╌╌╌╌┼╌╌╌╌╌┤
│ 3 ┆ 3 │
├╌╌╌╌╌┼╌╌╌╌╌┤
│ 4 ┆ 2 │
├╌╌╌╌╌┼╌╌╌╌╌┤
│ 5 ┆ 1 │
└─────┴─────┘
#lets try to inspect the returned expression onlyprint(pl.min(["*"]))
#oh it returns the same as pl.col("*"), that is very unexpected*
Polars version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of Polars.
Issue description
pl.min([str1,str2,str3,...])
andpl.max([str1,str2,str3,...])
have their own implementation which cannot handle a wildcard as it resolves the expression immediately.This issue is fixed in this PR #5511 be using the
pl.sum([...])
impl pattern on pl.min and pl.max. However someone should just check if this vector allocation is performance-wise ok.Reproducible example
Expected behavior
Installed versions
The text was updated successfully, but these errors were encountered: