alamb commented on code in PR #5730:
URL: https://github.com/apache/arrow-rs/pull/5730#discussion_r1600533138


##########
arrow-cast/src/cast/string.rs:
##########
@@ -112,8 +112,11 @@ fn cast_string_to_timestamp_impl<O: OffsetSizeTrait, T: 
ArrowTimestampType, Tz:
             .map(|v| {
                 v.map(|v| {
                     let naive = string_to_datetime(tz, v)?.naive_utc();
-                    T::make_value(naive).ok_or_else(|| {
-                        ArrowError::CastError(format!(
+                    T::make_value(naive).ok_or_else(|| match T::UNIT {
+                        TimeUnit::Nanosecond => ArrowError::CastError(format!(

Review Comment:
   I think you could create an array with `T::Min` of the underlying type
   
   something like (untested):
   ```rust
   let min_date = DateTimeArray::from(vec![i32::MIN, i32:MAX]));
   pretty_print(min_date)
   ```
   
   



-- 
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]

Reply via email to