From db73345d1a654c77849578fab5343b79bb4917e6 Mon Sep 17 00:00:00 2001 From: Nic Crane Date: Mon, 4 Oct 2021 16:42:27 +0100 Subject: [PATCH 01/15] Add count/tally functions, test, and acknolwedgement of dplyr license --- LICENSE.txt | 29 +++++++ r/DESCRIPTION | 1 + r/R/arrow-package.R | 2 +- r/R/dplyr-count-tally.R | 57 +++++++++++++ r/tests/testthat/test-dplyr-count-tally.R | 98 +++++++++++++++++++++++ 5 files changed, 186 insertions(+), 1 deletion(-) create mode 100644 r/R/dplyr-count-tally.R create mode 100644 r/tests/testthat/test-dplyr-count-tally.R diff --git a/LICENSE.txt b/LICENSE.txt index 52f471ed2eb..519a73f04f2 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -2242,3 +2242,32 @@ be copied, modified, or distributed except according to those terms. Distributed on an "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND, either express or implied. See your chosen license for details. + +-------------------------------------------------------------------------------- +r/R/dplyr-count-tally.R (some portions) + +Some portions of this file are derived from code from + +https://github.com/tidyverse/dplyr/ + +which is made available under the MIT license + +Copyright (c) 2013-2019 RStudio and others. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the “Software”), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/r/DESCRIPTION b/r/DESCRIPTION index 89d94305dd1..8497784b485 100644 --- a/r/DESCRIPTION +++ b/r/DESCRIPTION @@ -86,6 +86,7 @@ Collate: 'dictionary.R' 'dplyr-arrange.R' 'dplyr-collect.R' + 'dplyr-count-tally.R' 'dplyr-distinct.R' 'dplyr-eval.R' 'dplyr-filter.R' diff --git a/r/R/arrow-package.R b/r/R/arrow-package.R index 807aea207b7..7e39f5e22ac 100644 --- a/r/R/arrow-package.R +++ b/r/R/arrow-package.R @@ -37,7 +37,7 @@ "group_vars", "group_by_drop_default", "ungroup", "mutate", "transmute", "arrange", "rename", "pull", "relocate", "compute", "collapse", "distinct", "left_join", "right_join", "inner_join", "full_join", - "semi_join", "anti_join" + "semi_join", "anti_join", "count", "tally" ) ) for (cl in c("Dataset", "ArrowTabular", "arrow_dplyr_query")) { diff --git a/r/R/dplyr-count-tally.R b/r/R/dplyr-count-tally.R new file mode 100644 index 00000000000..f2fee6f2600 --- /dev/null +++ b/r/R/dplyr-count-tally.R @@ -0,0 +1,57 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# The following S3 methods are registered on load if dplyr is present + +count.arrow_dplyr_query <- function(x, ..., wt = NULL, sort = FALSE, name = NULL) { + if (!missing(...)) { + out <- group_by(x, ..., .add = TRUE, .drop = .drop) + } else { + out <- x + } + + out <- tally(out, wt = !!enquo(wt), sort = sort, name = name) + + # Restore original group vars + gv <- dplyr::group_vars(x) + if (length(gv)) { + out$group_by_vars <- gv + } + + out +} + +count.Dataset <- count.ArrowTabular <- count.arrow_dplyr_query + +tally.arrow_dplyr_query <- function(x, wt = NULL, sort = FALSE, name = NULL) { + n <- dplyr:::tally_n(x, {{ wt }}) + name <- dplyr:::check_name(name, group_vars(x)) + + out <- local({ + old.options <- options(dplyr.summarise.inform = FALSE) + on.exit(options(old.options)) + summarise(x, !!name := !!n) + }) + + if (sort) { + arrange(out, desc(!!sym(name))) + } else { + out + } +} + +tally.Dataset <- tally.ArrowTabular <- tally.arrow_dplyr_query diff --git a/r/tests/testthat/test-dplyr-count-tally.R b/r/tests/testthat/test-dplyr-count-tally.R new file mode 100644 index 00000000000..f1f2a83cdd1 --- /dev/null +++ b/r/tests/testthat/test-dplyr-count-tally.R @@ -0,0 +1,98 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +skip_if_not_available("dataset") + +library(dplyr, warn.conflicts = FALSE) + +tbl <- example_data +tbl$some_grouping <- rep(c(1, 2), 5) + +test_that("count/tally", { + + expect_dplyr_equal( + input %>% + count() %>% + collect(), + tbl + ) + + expect_dplyr_equal( + input %>% + tally() %>% + collect(), + tbl + ) + +}) + +test_that("count/tally with wt and grouped data", { + expect_dplyr_equal( + input %>% + group_by(some_grouping) %>% + count(wt = int) %>% + collect(), + tbl + ) + + expect_dplyr_equal( + input %>% + group_by(some_grouping) %>% + tally(wt = int) %>% + collect(), + tbl + ) + +}) + +test_that("count/tally with sort", { + expect_dplyr_equal( + input %>% + group_by(some_grouping) %>% + count(wt = int, sort = TRUE) %>% + collect(), + tbl + ) + + expect_dplyr_equal( + input %>% + group_by(some_grouping) %>% + tally(wt = int, sort = TRUE) %>% + collect(), + tbl + ) + +}) + +test_that("count/tally with name arg", { + + expect_dplyr_equal( + input %>% + count(name = "new_col") %>% + collect(), + tbl + ) + + expect_dplyr_equal( + input %>% + tally(name = "new_col") %>% + collect(), + tbl + ) + +}) From cf8b0d4eb6125d4b51b2d57978fc3800e67191a9 Mon Sep 17 00:00:00 2001 From: Nic Date: Mon, 4 Oct 2021 17:01:41 +0100 Subject: [PATCH 02/15] Update r/R/dplyr-count-tally.R Co-authored-by: Neal Richardson --- r/R/dplyr-count-tally.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/r/R/dplyr-count-tally.R b/r/R/dplyr-count-tally.R index f2fee6f2600..103b7be71de 100644 --- a/r/R/dplyr-count-tally.R +++ b/r/R/dplyr-count-tally.R @@ -19,7 +19,7 @@ count.arrow_dplyr_query <- function(x, ..., wt = NULL, sort = FALSE, name = NULL) { if (!missing(...)) { - out <- group_by(x, ..., .add = TRUE, .drop = .drop) + out <- group_by(x, ..., .add = TRUE) } else { out <- x } From c9b517c1bfa221ae84bf8a63e1cbca6dd18bf4d1 Mon Sep 17 00:00:00 2001 From: Nic Date: Mon, 4 Oct 2021 17:06:29 +0100 Subject: [PATCH 03/15] Update r/R/dplyr-count-tally.R Co-authored-by: Neal Richardson --- r/R/dplyr-count-tally.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/r/R/dplyr-count-tally.R b/r/R/dplyr-count-tally.R index 103b7be71de..123bdc39880 100644 --- a/r/R/dplyr-count-tally.R +++ b/r/R/dplyr-count-tally.R @@ -24,7 +24,7 @@ count.arrow_dplyr_query <- function(x, ..., wt = NULL, sort = FALSE, name = NULL out <- x } - out <- tally(out, wt = !!enquo(wt), sort = sort, name = name) + out <- tally(out, wt = {{ wt }}, sort = sort, name = name) # Restore original group vars gv <- dplyr::group_vars(x) From 7ace79b07b2d4291602731a6a8967dc1cfcc3471 Mon Sep 17 00:00:00 2001 From: Nic Crane Date: Mon, 4 Oct 2021 17:10:15 +0100 Subject: [PATCH 04/15] Changes from code review --- r/R/dplyr-count-tally.R | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/r/R/dplyr-count-tally.R b/r/R/dplyr-count-tally.R index 123bdc39880..f777add2ffc 100644 --- a/r/R/dplyr-count-tally.R +++ b/r/R/dplyr-count-tally.R @@ -38,8 +38,8 @@ count.arrow_dplyr_query <- function(x, ..., wt = NULL, sort = FALSE, name = NULL count.Dataset <- count.ArrowTabular <- count.arrow_dplyr_query tally.arrow_dplyr_query <- function(x, wt = NULL, sort = FALSE, name = NULL) { - n <- dplyr:::tally_n(x, {{ wt }}) - name <- dplyr:::check_name(name, group_vars(x)) + n <- tally_n(x, {{ wt }}) + name <- check_name(name, group_vars(x)) out <- local({ old.options <- options(dplyr.summarise.inform = FALSE) @@ -55,3 +55,16 @@ tally.arrow_dplyr_query <- function(x, wt = NULL, sort = FALSE, name = NULL) { } tally.Dataset <- tally.ArrowTabular <- tally.arrow_dplyr_query + +tally_n <- function(x, wt){ + wt <- enquo(wt) + + if (quo_is_null(wt)) { + expr(n()) + } + else{ + expr(sum(!!wt, na.rm = TRUE)) + } +} + +check_name <- utils::getFromNamespace("check_name", "dplyr") From 999bd871ccf0e922214d9cf91db1f68ca2416789 Mon Sep 17 00:00:00 2001 From: Nic Crane Date: Mon, 4 Oct 2021 17:11:06 +0100 Subject: [PATCH 05/15] Remove extraneous utils call --- r/R/dplyr-count-tally.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/r/R/dplyr-count-tally.R b/r/R/dplyr-count-tally.R index f777add2ffc..c71ac139a40 100644 --- a/r/R/dplyr-count-tally.R +++ b/r/R/dplyr-count-tally.R @@ -67,4 +67,4 @@ tally_n <- function(x, wt){ } } -check_name <- utils::getFromNamespace("check_name", "dplyr") +check_name <- getFromNamespace("check_name", "dplyr") From 78bd438d23190c792292cb7bf94c0197a3948f5a Mon Sep 17 00:00:00 2001 From: Nic Crane Date: Mon, 4 Oct 2021 17:49:49 +0100 Subject: [PATCH 06/15] Style files. --- r/R/dplyr-count-tally.R | 5 ++--- r/tests/testthat/test-dplyr-count-tally.R | 6 ------ 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/r/R/dplyr-count-tally.R b/r/R/dplyr-count-tally.R index c71ac139a40..a178129b09a 100644 --- a/r/R/dplyr-count-tally.R +++ b/r/R/dplyr-count-tally.R @@ -56,13 +56,12 @@ tally.arrow_dplyr_query <- function(x, wt = NULL, sort = FALSE, name = NULL) { tally.Dataset <- tally.ArrowTabular <- tally.arrow_dplyr_query -tally_n <- function(x, wt){ +tally_n <- function(x, wt) { wt <- enquo(wt) if (quo_is_null(wt)) { expr(n()) - } - else{ + } else { expr(sum(!!wt, na.rm = TRUE)) } } diff --git a/r/tests/testthat/test-dplyr-count-tally.R b/r/tests/testthat/test-dplyr-count-tally.R index f1f2a83cdd1..1a852e19999 100644 --- a/r/tests/testthat/test-dplyr-count-tally.R +++ b/r/tests/testthat/test-dplyr-count-tally.R @@ -24,7 +24,6 @@ tbl <- example_data tbl$some_grouping <- rep(c(1, 2), 5) test_that("count/tally", { - expect_dplyr_equal( input %>% count() %>% @@ -38,7 +37,6 @@ test_that("count/tally", { collect(), tbl ) - }) test_that("count/tally with wt and grouped data", { @@ -57,7 +55,6 @@ test_that("count/tally with wt and grouped data", { collect(), tbl ) - }) test_that("count/tally with sort", { @@ -76,11 +73,9 @@ test_that("count/tally with sort", { collect(), tbl ) - }) test_that("count/tally with name arg", { - expect_dplyr_equal( input %>% count(name = "new_col") %>% @@ -94,5 +89,4 @@ test_that("count/tally with name arg", { collect(), tbl ) - }) From 4fe983d3de02497b766cdf7ebc3311ff7b3c27fc Mon Sep 17 00:00:00 2001 From: Nic Crane Date: Wed, 6 Oct 2021 13:42:42 +0100 Subject: [PATCH 07/15] Unskip test --- r/tests/testthat/test-dataset-dplyr.R | 1 - 1 file changed, 1 deletion(-) diff --git a/r/tests/testthat/test-dataset-dplyr.R b/r/tests/testthat/test-dataset-dplyr.R index db5541507fb..907df32fa10 100644 --- a/r/tests/testthat/test-dataset-dplyr.R +++ b/r/tests/testthat/test-dataset-dplyr.R @@ -186,7 +186,6 @@ test_that("collect() on Dataset works (if fits in memory)", { }) test_that("count()", { - skip("count() is not a generic so we have to get here through summarize()") ds <- open_dataset(dataset_dir) df <- rbind(df1, df2) expect_equal( From d629c423378329b666ff3224ec1240099241c3d6 Mon Sep 17 00:00:00 2001 From: Nic Crane Date: Wed, 6 Oct 2021 13:51:45 +0100 Subject: [PATCH 08/15] Simplify code --- r/R/dplyr-count-tally.R | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/r/R/dplyr-count-tally.R b/r/R/dplyr-count-tally.R index a178129b09a..892cfabce56 100644 --- a/r/R/dplyr-count-tally.R +++ b/r/R/dplyr-count-tally.R @@ -23,7 +23,6 @@ count.arrow_dplyr_query <- function(x, ..., wt = NULL, sort = FALSE, name = NULL } else { out <- x } - out <- tally(out, wt = {{ wt }}, sort = sort, name = name) # Restore original group vars @@ -38,14 +37,16 @@ count.arrow_dplyr_query <- function(x, ..., wt = NULL, sort = FALSE, name = NULL count.Dataset <- count.ArrowTabular <- count.arrow_dplyr_query tally.arrow_dplyr_query <- function(x, wt = NULL, sort = FALSE, name = NULL) { - n <- tally_n(x, {{ wt }}) + + wt <- enquo(wt) + name <- check_name(name, group_vars(x)) - out <- local({ - old.options <- options(dplyr.summarise.inform = FALSE) - on.exit(options(old.options)) - summarise(x, !!name := !!n) - }) + if (quo_is_null(wt)) { + out <- dplyr::summarize(x, {{name}} := n()) + } else { + out <- dplyr::summarize(x, {{name}} := sum(!!wt, na.rm = TRUE)) + } if (sort) { arrange(out, desc(!!sym(name))) @@ -56,14 +57,4 @@ tally.arrow_dplyr_query <- function(x, wt = NULL, sort = FALSE, name = NULL) { tally.Dataset <- tally.ArrowTabular <- tally.arrow_dplyr_query -tally_n <- function(x, wt) { - wt <- enquo(wt) - - if (quo_is_null(wt)) { - expr(n()) - } else { - expr(sum(!!wt, na.rm = TRUE)) - } -} - check_name <- getFromNamespace("check_name", "dplyr") From fe2391475f7682b42f6eec1cd531f637e47e338a Mon Sep 17 00:00:00 2001 From: Nic Crane Date: Wed, 6 Oct 2021 13:56:28 +0100 Subject: [PATCH 09/15] Move finding check_name into body of function --- r/R/dplyr-count-tally.R | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/r/R/dplyr-count-tally.R b/r/R/dplyr-count-tally.R index 892cfabce56..2424403d212 100644 --- a/r/R/dplyr-count-tally.R +++ b/r/R/dplyr-count-tally.R @@ -40,6 +40,7 @@ tally.arrow_dplyr_query <- function(x, wt = NULL, sort = FALSE, name = NULL) { wt <- enquo(wt) + check_name <- getFromNamespace("check_name", "dplyr") name <- check_name(name, group_vars(x)) if (quo_is_null(wt)) { @@ -56,5 +57,3 @@ tally.arrow_dplyr_query <- function(x, wt = NULL, sort = FALSE, name = NULL) { } tally.Dataset <- tally.ArrowTabular <- tally.arrow_dplyr_query - -check_name <- getFromNamespace("check_name", "dplyr") From 4456fcb08539204c22191709353af1e03f3b33aa Mon Sep 17 00:00:00 2001 From: Nic Crane Date: Wed, 6 Oct 2021 14:16:53 +0100 Subject: [PATCH 10/15] Fix tests --- r/R/dplyr-count-tally.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/r/R/dplyr-count-tally.R b/r/R/dplyr-count-tally.R index 2424403d212..63b75757f6a 100644 --- a/r/R/dplyr-count-tally.R +++ b/r/R/dplyr-count-tally.R @@ -44,9 +44,9 @@ tally.arrow_dplyr_query <- function(x, wt = NULL, sort = FALSE, name = NULL) { name <- check_name(name, group_vars(x)) if (quo_is_null(wt)) { - out <- dplyr::summarize(x, {{name}} := n()) + out <- dplyr::summarize(x, !!name := n()) } else { - out <- dplyr::summarize(x, {{name}} := sum(!!wt, na.rm = TRUE)) + out <- dplyr::summarize(x, !!name := sum(!!wt, na.rm = TRUE)) } if (sort) { From c26517a60ed3a15354c4722a17d80eb2b5ed77ec Mon Sep 17 00:00:00 2001 From: Nic Date: Wed, 6 Oct 2021 16:59:38 +0100 Subject: [PATCH 11/15] Update r/R/dplyr-count-tally.R Co-authored-by: Neal Richardson --- r/R/dplyr-count-tally.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/r/R/dplyr-count-tally.R b/r/R/dplyr-count-tally.R index 63b75757f6a..ea63782ece8 100644 --- a/r/R/dplyr-count-tally.R +++ b/r/R/dplyr-count-tally.R @@ -41,7 +41,7 @@ tally.arrow_dplyr_query <- function(x, wt = NULL, sort = FALSE, name = NULL) { wt <- enquo(wt) check_name <- getFromNamespace("check_name", "dplyr") - name <- check_name(name, group_vars(x)) + name <- check_name(name, dplyr::group_vars(x)) if (quo_is_null(wt)) { out <- dplyr::summarize(x, !!name := n()) From 27ee29bbeea66780335c8da2c9012a67665f08c9 Mon Sep 17 00:00:00 2001 From: Nic Date: Wed, 6 Oct 2021 17:16:49 +0100 Subject: [PATCH 12/15] Update r/R/dplyr-count-tally.R Co-authored-by: Neal Richardson --- r/R/dplyr-count-tally.R | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/r/R/dplyr-count-tally.R b/r/R/dplyr-count-tally.R index ea63782ece8..02ae44baac0 100644 --- a/r/R/dplyr-count-tally.R +++ b/r/R/dplyr-count-tally.R @@ -38,15 +38,13 @@ count.Dataset <- count.ArrowTabular <- count.arrow_dplyr_query tally.arrow_dplyr_query <- function(x, wt = NULL, sort = FALSE, name = NULL) { - wt <- enquo(wt) - check_name <- getFromNamespace("check_name", "dplyr") name <- check_name(name, dplyr::group_vars(x)) - if (quo_is_null(wt)) { + if (quo_is_null(enquo(wt))) { out <- dplyr::summarize(x, !!name := n()) } else { - out <- dplyr::summarize(x, !!name := sum(!!wt, na.rm = TRUE)) + out <- dplyr::summarize(x, !!name := sum({{ wt }}, na.rm = TRUE)) } if (sort) { From 23dd3df0480d33d093a6c2cf8650a5e216ee0f3c Mon Sep 17 00:00:00 2001 From: Neal Richardson Date: Wed, 6 Oct 2021 17:27:57 -0400 Subject: [PATCH 13/15] Fix failing tests --- r/R/util.R | 5 +++++ r/tests/testthat/test-dataset-dplyr.R | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/r/R/util.R b/r/R/util.R index ab6753b09c1..54c2be620e2 100644 --- a/r/R/util.R +++ b/r/R/util.R @@ -66,6 +66,11 @@ r_symbolic_constants <- c( ) is_function <- function(expr, name) { + # We could have a quosure here if we have an expression like + # `sum({{ var }})` + if (is_quosure(expr)) { + expr <- quo_get_expr(expr) + } if (!is.call(expr)) { return(FALSE) } else { diff --git a/r/tests/testthat/test-dataset-dplyr.R b/r/tests/testthat/test-dataset-dplyr.R index 907df32fa10..e1a9d1cb6a9 100644 --- a/r/tests/testthat/test-dataset-dplyr.R +++ b/r/tests/testthat/test-dataset-dplyr.R @@ -191,7 +191,9 @@ test_that("count()", { expect_equal( ds %>% filter(int > 6, int < 108) %>% - count(chr), + count(chr) %>% + arrange(chr) %>% + collect(), df %>% filter(int > 6, int < 108) %>% count(chr) From 958a87b1a33da191f6398dd8f2a5556c064d2fea Mon Sep 17 00:00:00 2001 From: Nic Date: Thu, 7 Oct 2021 15:47:51 +0100 Subject: [PATCH 14/15] Update r/R/dplyr-count-tally.R Co-authored-by: Neal Richardson --- r/R/dplyr-count-tally.R | 1 - 1 file changed, 1 deletion(-) diff --git a/r/R/dplyr-count-tally.R b/r/R/dplyr-count-tally.R index 02ae44baac0..147a1ac84f1 100644 --- a/r/R/dplyr-count-tally.R +++ b/r/R/dplyr-count-tally.R @@ -37,7 +37,6 @@ count.arrow_dplyr_query <- function(x, ..., wt = NULL, sort = FALSE, name = NULL count.Dataset <- count.ArrowTabular <- count.arrow_dplyr_query tally.arrow_dplyr_query <- function(x, wt = NULL, sort = FALSE, name = NULL) { - check_name <- getFromNamespace("check_name", "dplyr") name <- check_name(name, dplyr::group_vars(x)) From 7837bed0edb6078cfefd76c0b4907e55f44f9d2d Mon Sep 17 00:00:00 2001 From: Nic Date: Fri, 8 Oct 2021 11:33:30 +0100 Subject: [PATCH 15/15] Update r/R/util.R --- r/R/util.R | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/r/R/util.R b/r/R/util.R index 54c2be620e2..9e3ade6a967 100644 --- a/r/R/util.R +++ b/r/R/util.R @@ -66,8 +66,7 @@ r_symbolic_constants <- c( ) is_function <- function(expr, name) { - # We could have a quosure here if we have an expression like - # `sum({{ var }})` + # We could have a quosure here if we have an expression like `sum({{ var }})` if (is_quosure(expr)) { expr <- quo_get_expr(expr) }