ianmcook commented on a change in pull request #10751:
URL: https://github.com/apache/arrow/pull/10751#discussion_r673499195
##########
File path: r/R/dplyr-functions.R
##########
@@ -57,6 +57,44 @@ nse_funcs$cast <- function(x, target_type, safe = TRUE, ...)
{
Expression$create("cast", x, options = opts)
}
+nse_funcs$coalesce <- function(...) {
+ args <- list2(...)
+ if (length(args) < 1) {
+ abort("At least one argument must be supplied to coalesce()")
+ }
+
+ # Treat NaN like NA for consistency with dplyr::coalesce():
+ # if *all* the values are NaN, we should return NaN, not NA, so don't replace
Review comment:
```suggestion
# Treat NaN like NA for consistency with dplyr::coalesce(), but if *all*
# the values are NaN, we should return NaN, not NA, so don't replace
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]