Element-wise multiplication & division of pl.Decimal
silently fail and produce inconsistent results
#17046
Open
2 tasks done
Labels
A-dtype-decimal
Area: decimal data type
A-ops
Area: operations
bug
Something isn't working
P-medium
Priority: medium
python
Related to Python Polars
Checks
1.0.0-beta.1
to date).Reproducible example
The following test passes with
float
but fails withDecimal
as a datatype:Issue description
Some very basic element-wise operations between
Decimal
values fail, probably because of an overflow, without explicit warning nor error message.This is a very nasty bug: in an element-wise multiplication, the output values may be plausible, but turn out to be completely wrong, making it really hard to debug. Here, I've tried to reduce the problem to its most transparent form (multiplying
1
by1
must equal1
, not0.013...
), but I'm sure other people could tear their hair out over it.I know polars only partially supports
Decimal
, I'm aware that it's a "work-in-progress feature", I tend to believe that this issue should be fixed before polars can claim to support this datatype. I marked this as a python bug since that is how I stumbled over it but I wouldn't be surprised if the same bug exists in Rust.This could be related to #15037 in the sense that in both cases the root of the issue is likely a silent overflow.
Expected behavior
An explicit exception should be raised or a warning should be displayed.
Installed versions
The text was updated successfully, but these errors were encountered: