You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/06/21 16:42:40 UTC

[GitHub] [arrow] nealrichardson commented on a change in pull request #10559: ARROW-13125: [R] Throw error when 2+ args passed to desc() in arrange()

nealrichardson commented on a change in pull request #10559:
URL: https://github.com/apache/arrow/pull/10559#discussion_r655544775



##########
File path: r/R/dplyr-arrange.R
##########
@@ -77,6 +77,10 @@ find_and_remove_desc <- function(quosure) {
       # remove enclosing parentheses
       expr <- expr[[2]]
     } else if (identical(expr[[1]], quote(desc))) {
+      # ensure desc() has only one argument
+      if (length(expr) > 2) {
+        stop("desc() expects only one argument", call. = FALSE)
+      }

Review comment:
       dplyr doesn't error on this (and also appears to ignore the second argument): 
   
   ```r
   mtcars %>% arrange(desc(cyl, hp))
   ```
   
   Notably `mtcars %>% arrange(desc(cyl, asdfasdf))` does not error.
   
   Seems like something that should be reported upstream too--can you do that?




-- 
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:
users@infra.apache.org