pl.when
produces wrong result, depending on the values in .then(..)
. Used to work in 1.5.0
#19122
Closed
2 tasks done
Checks
Reproducible example
Log output
Issue description
Initially, I was converting numpy complex data to a polars format by using a struct with 2 fields (real, imag).
When I upgraded from polars 1.5.0 to 1.9.0, I noticed a regression in my unittests (see above for reproducible exemple)
When checking if any of the field contain nans (in order to replace with a null), I instead get an output full of null, except of only nulls where there are nans in my input data.
This behavior seems to depend on the content in the
.then(<values>)
part (!), as can be seen in my example code.Expected behavior
The assert should not fail in my reproducible example.
The output of
pl.when(A).then(B).otherwise(C)
should not depend on B if A is always False.Installed versions
The text was updated successfully, but these errors were encountered: