Skip to content

Commit

Permalink
separate the test case
Browse files Browse the repository at this point in the history
Signed-off-by: SHIMA Tatsuya <ts1s1andn@gmail.com>
  • Loading branch information
eitsupi committed Oct 7, 2022
1 parent 1b26588 commit 1a41638
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions r/tests/testthat/test-dplyr-group-by.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,24 @@ test_that("ungroup", {
collect(),
tbl
)

# to confirm that the above expectation is actually testing what we think it's
# testing, verify that compare_dplyr_binding() distinguishes between grouped and
# ungrouped tibbles
expect_error(
compare_dplyr_binding(
.input %>%
group_by(chr) %>%
select(int, chr) %>%
(function(x) if (inherits(x, "tbl_df")) ungroup(x) else x) %>%
filter(int > 5) %>%
collect(),
tbl
)
)
})

test_that("Groups before conversion to a Table must not be restored after collect() (ARROW-17737)", {
compare_dplyr_binding(
.input %>%
group_by(chr, .add = FALSE) %>%
Expand All @@ -78,21 +96,6 @@ test_that("ungroup", {
tbl %>%
group_by(int)
)

# to confirm that the above expectation is actually testing what we think it's
# testing, verify that compare_dplyr_binding() distinguishes between grouped and
# ungrouped tibbles
expect_error(
compare_dplyr_binding(
.input %>%
group_by(chr) %>%
select(int, chr) %>%
(function(x) if (inherits(x, "tbl_df")) ungroup(x) else x) %>%
filter(int > 5) %>%
collect(),
tbl
)
)
})

test_that("group_by then rename", {
Expand Down

0 comments on commit 1a41638

Please sign in to comment.