viirya commented on code in PR #2713:
URL: https://github.com/apache/arrow-rs/pull/2713#discussion_r971363755
##########
arrow/src/compute/kernels/arity.rs:
##########
@@ -162,6 +177,30 @@ where
}
}
+/// Applies a fallible unary function to an array with primitive values.
+pub fn try_unary_dyn<F, T>(array: &dyn Array, op: F) -> Result<ArrayRef>
+where
+ T: ArrowPrimitiveType,
+ F: Fn(T::Native) -> Result<T::Native>,
+{
+ downcast_dictionary_array! {
+ array => try_unary_dict::<_, F, T>(array, op),
Review Comment:
Oh, right, actually I thought to handle it at `try_unary_dict`. But this fix
looks okay as `try_unary_dict` is currently used here and not public. I may fix
at `try_unary_dict` at another followup.
--
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]