tustvold commented on code in PR #5479:
URL: https://github.com/apache/arrow-rs/pull/5479#discussion_r1515183564
##########
arrow-array/src/types.rs:
##########
@@ -1001,7 +1004,7 @@ impl Date32Type {
/// * `i` - The Date32Type to convert
pub fn to_naive_date(i: <Date32Type as ArrowPrimitiveType>::Native) ->
NaiveDate {
let epoch = NaiveDate::from_ymd_opt(1970, 1, 1).unwrap();
- epoch.add(Duration::days(i as i64))
+ epoch.add(Duration::try_days(i as i64).unwrap())
Review Comment:
Making these not panic is tracked by
https://github.com/apache/arrow-rs/issues/4456
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]