Strict cast of Duration/Datetime to higher precision may overflow #14655
Labels
A-arithmetic
Area: arithmetic
A-timeseries
Area: date/time functionality
bug
Something isn't working
P-low
Priority: low
python
Related to Python Polars
Checks
Reproducible example
Log output
shape: (1,) Series: '' [duration[ns]] [ -1µs ]
Issue description
Strict casting should protect against overflows, but it doesn't in this case.
The issue is that this cast multiplies the underlying physical value by 1000. Since our arithmetic currently does not do overflow checks, we have no way to enforce a strict cast here.
Expected behavior
An error (
ComputeError
?).Non-strict cast should result in
null
.Installed versions
main
The text was updated successfully, but these errors were encountered: