tustvold commented on code in PR #5337:
URL: https://github.com/apache/arrow-rs/pull/5337#discussion_r1471129484


##########
arrow-arith/src/temporal.rs:
##########
@@ -180,18 +180,88 @@ trait ExtractDatePartExt {
 impl ExtractDatePartExt for PrimitiveArray<Time32SecondType> {
     fn date_part(&self, part: DatePart) -> Result<Int32Array, ArrowError> {
         match part {
-            DatePart::Hour => Ok(self.unary_opt(|d| time32s_to_time(d).map(|c| 
c.hour() as i32))),
-            // TODO expand support for Time types, see: 
https://github.com/apache/arrow-rs/issues/5261
+            DatePart::Hour => Ok(self.unary_opt(|s| {
+                if (0..SECONDS_IN_DAY as i32).contains(&s) {

Review Comment:
   Using Option::then might make this more concise



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