jonkeane commented on a change in pull request #10888:
URL: https://github.com/apache/arrow/pull/10888#discussion_r699546925



##########
File path: r/R/dplyr-filter.R
##########
@@ -71,8 +71,15 @@ filter.Dataset <- filter.ArrowTabular <- 
filter.arrow_dplyr_query
 
 set_filters <- function(.data, expressions) {
   if (length(expressions)) {
-    # expressions is a list of Expressions. AND them together and set them on 
.data
-    new_filter <- Reduce("&", expressions)
+    if (is.list(expressions)) {
+      # expressions is a list of Expressions. AND them together and set them 
on .data
+      new_filter <- Reduce("&", expressions)
+    } else {
+      # expressions should be an expression or list of expressions already
+      stopifnot(is_list_of(expressions, "Expression") | inherits(expressions, 
"Expression"))
+      new_filter <- expressions
+    }

Review comment:
       Yeah, this is a holdover from a previous construction where this was 
outside of the if. Lemme move this around like you suggest.




-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to