Abdi-29 commented on code in PR #5730:
URL: https://github.com/apache/arrow-rs/pull/5730#discussion_r1597420306
##########
arrow-cast/src/cast/mod.rs:
##########
@@ -8057,6 +8057,35 @@ mod tests {
test_cast_string_to_decimal256_overflow(overflow_array);
}
+ #[test]
+ fn test_cast_outside_supported_range_for_nanoseconds() {
+ const EXPECTED_ERROR_MESSAGE: &str = "The dates that can be
represented as nanoseconds have to be between 1677-09-21T00:12:44.0 and
2262-04-11T23:47:16.854775804";
+
+ let array = StringArray::from(vec![Some("1650-01-01
01:01:01.000001")]);
+
+ let cast_options = CastOptions {
+ safe: false,
+ format_options: FormatOptions::default(),
+ };
+
+ let result = cast_string_to_timestamp::<i32, TimestampNanosecondType>(
+ &array,
+ &None::<Arc<str>>,
+ &cast_options,
+ );
+
+ assert!(result.is_err());
Review Comment:
I'll remove that part, Thanks alamb for the feedback
--
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]