naosense commented on code in PR #3016:
URL: https://github.com/apache/arrow-rs/pull/3016#discussion_r1017716012
##########
arrow-cast/src/cast.rs:
##########
@@ -527,6 +534,29 @@ fn make_timestamp_array(
}
}
+fn as_time_res_with_timezone<T: ArrowPrimitiveType>(
+ v: i64,
+ tz: Tz,
+) -> Result<NaiveTime, ArrowError> {
+ match as_datetime_with_timezone::<T>(v, tz) {
+ Some(dt) => Ok(dt.time()),
+ None => Err(ArrowError::CastError(format!(
+ "Failed to create naive time with {} {}",
+ std::any::type_name::<T>(),
+ v
+ ))),
+ }
+}
+
+fn as_timezone_res(tz: &Option<String>) -> Result<Tz, ArrowError> {
+ match tz {
+ Some(s) => s.parse(),
+ None => Err(ArrowError::ParseError(
+ "Timezone must not be none".to_string(),
+ )),
+ }
+}
Review Comment:
ok, I'll do it
--
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]