ianmcook commented on a change in pull request #10032:
URL: https://github.com/apache/arrow/pull/10032#discussion_r614086125



##########
File path: r/R/compute.R
##########
@@ -186,6 +186,32 @@ unique.ArrowDatum <- function(x, incomparables = FALSE, 
...) {
   call_function("unique", x)
 }
 
+#' @export
+any.ArrowDatum <- function(..., na.rm = FALSE){
+  
+  a <- collect_arrays_from_dots(list(...))
+  result <- call_function("any", a)
+
+  if(!as.vector(result) && a$null_count > 0 && !na.rm){

Review comment:
       It would be best to put the `!na.rm` at the beginning here, because it's 
the only one of these three logicals that does not have any compute cost to 
calculate. Putting it the beginning allows the expression to short-circuit and 
never evaluate the other two if `na.rm` is `TRUE`




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to