-
Notifications
You must be signed in to change notification settings - Fork 837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overflow when casting timestamps prior to the epoch #3512
Comments
@alamb can I take this? |
This is known limitation.
Nice message from authors :) |
@comphead IMO, need to avoid this and at least return an error instead 🤔 |
That would be consistent with how we handle overflow when casting in other places, or if the string is not valid |
I agree -- an error would be my preferred behavior here -- I think we can just inline the implementation of |
Updated the expected behavior to "return error" |
Most methods in chrono now have non-panicking variants, so it is likely just a case of finding the right one to call |
|
Describe the bug
When a string such as
'1677-06-14T07:29:01.256'
is casted to a timestamp (viastring_to_timestamp_nanos
) it panics in debug builds and gives a wonky answer in release builds.To Reproduce
Run this test in
arrow-cast/src/display.rs
Expected behavior
It should not panic; It should return an error
Additional context
Found in datafusion apache/datafusion#4875 by @DDtKey
The actual panic is in chrono, it appears to be this line
arrow-rs/arrow-cast/src/parse.rs
Lines 99 to 103 in 55c87c1
The text was updated successfully, but these errors were encountered: