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 2022/01/19 16:31:35 UTC

[GitHub] [arrow] paleolimbot commented on a change in pull request #12179: ARROW-14609 [R] left_join by argument error message mismatch

paleolimbot commented on a change in pull request #12179:
URL: https://github.com/apache/arrow/pull/12179#discussion_r787927677



##########
File path: r/R/dplyr-join.R
##########
@@ -117,10 +117,30 @@ handle_join_by <- function(by, x, y) {
   if (is.null(names(by))) {
     by <- set_names(by)
   }
-  # TODO: nicer messages?
-  stopifnot(
-    all(names(by) %in% names(x)),
-    all(by %in% names(y))
-  )
+
+  missing_x_cols <- setdiff(names(by), names(x))
+  missing_y_cols <- setdiff(by, names(y))
+  message_x <- NULL
+  message_y <- NULL
+
+  if (length(missing_x_cols) > 0) {
+    message_x <- paste(
+      oxford_paste(missing_x_cols, quote_symbol = "`"),
+      "not present in x."
+      )

Review comment:
       ```suggestion
       )
   ```




-- 
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-unsubscribe@arrow.apache.org

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