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/05/31 16:54:53 UTC

[GitHub] [arrow] pachadotdev commented on a change in pull request #9999: ARROW-11755: [R] Add tests from dplyr/test-mutate.r

pachadotdev commented on a change in pull request #9999:
URL: https://github.com/apache/arrow/pull/9999#discussion_r642601213



##########
File path: r/tests/testthat/test-dplyr-mutate.R
##########
@@ -32,59 +51,23 @@ test_that("mutate() is lazy", {
   )
 })
 
-test_that("basic mutate", {
-  expect_dplyr_equal(
-    input %>%
-      select(int, chr) %>%
-      filter(int > 5) %>%
-      mutate(int = int + 6L) %>%
-      collect(),
-    tbl
-  )
-})
+# similar to https://github.com/tidyverse/dplyr/blob/master/tests/testthat/test-mutate.r#L1-L10
+test_that("empty mutate returns input", {
+  # dbl2 = 5, so I'm grouping by a constant
+  gtbl <- group_by(tbl, dbl2)
 
-test_that("mutate() with NULL inputs", {
-  expect_dplyr_equal(
-    input %>%
-      mutate(int = NULL) %>%
-      collect(),
-    tbl
-  )
+  expect_dplyr_equal(input %>% mutate() %>% collect(), tbl)
+  expect_dplyr_equal(input %>% mutate(!!!list()) %>% collect(), tbl)
+  expect_dplyr_equal(input %>% mutate() %>% collect(), gtbl)
+  expect_dplyr_equal(input %>% mutate(!!!list()) %>% collect(), gtbl)

Review comment:
       thanks for letting me know this!
   I shall edit accordingly




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