You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "thisisnic (via GitHub)" <gi...@apache.org> on 2026/09/12 13:23:35 UTC

[PR] GH-34860: [R] New column name wrongly set when using mutate with if_any [arrow]

thisisnic opened a new pull request, #51314:
URL: https://github.com/apache/arrow/pull/51314

   ### Rationale for this change
   
   We got errors with new column names when using `mutate()` with `if_any()` due to not having access to column name
   
   ### What changes are included in this PR?
   
   Set the names 
   
   ### Are these changes tested?
   
   Yeah
   
   ### Are there any user-facing changes?
   
   Yeah


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


Re: [PR] GH-34860: [R] New column name wrongly set when using mutate with if_any [arrow]

Posted by "thisisnic (via GitHub)" <gi...@apache.org>.
thisisnic merged PR #51314:
URL: https://github.com/apache/arrow/pull/51314


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


Re: [PR] GH-34860: [R] New column name wrongly set when using mutate with if_any [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #51314:
URL: https://github.com/apache/arrow/pull/51314#issuecomment-5646158960

   :warning: GitHub issue #34860 **has been automatically assigned in GitHub** to PR creator.


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


Re: [PR] GH-34860: [R] New column name wrongly set when using mutate with if_any [arrow]

Posted by "jonkeane (via GitHub)" <gi...@apache.org>.
jonkeane commented on code in PR #51314:
URL: https://github.com/apache/arrow/pull/51314#discussion_r4030670743


##########
r/R/dplyr-across.R:
##########
@@ -59,18 +59,18 @@ expand_across <- function(.data, quos_in, exclude_cols = NULL) {
 
       new_quos <- quosures_from_setup(setup, quo_env)
 
+      # if_any()/if_all() collapse the expanded quosures into a single
+      # expression, keeping whatever name the user gave the call
+      if (is_call(quo_expr, c("if_any", "if_all"))) {
+        op <- if (is_call(quo_expr, "if_any")) "|" else "&"

Review Comment:
   I'm fine to run with it, but the inline if/else is a little 🤢



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


Re: [PR] GH-34860: [R] New column name wrongly set when using mutate with if_any [arrow]

Posted by "thisisnic (via GitHub)" <gi...@apache.org>.
thisisnic commented on code in PR #51314:
URL: https://github.com/apache/arrow/pull/51314#discussion_r4039413838


##########
r/R/dplyr-across.R:
##########
@@ -59,18 +59,18 @@ expand_across <- function(.data, quos_in, exclude_cols = NULL) {
 
       new_quos <- quosures_from_setup(setup, quo_env)
 
+      # if_any()/if_all() collapse the expanded quosures into a single
+      # expression, keeping whatever name the user gave the call
+      if (is_call(quo_expr, c("if_any", "if_all"))) {
+        op <- if (is_call(quo_expr, "if_any")) "|" else "&"

Review Comment:
   You're not wrong, I'll update



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