ianmcook commented on a change in pull request #11175:
URL: https://github.com/apache/arrow/pull/11175#discussion_r712603016
##########
File path: r/tests/testthat/test-dplyr-group-by.R
##########
@@ -62,9 +62,23 @@ test_that("ungroup", {
select(int, chr) %>%
ungroup() %>%
filter(int > 5) %>%
- summarize(min_int = min(int)),
- tbl,
- warning = TRUE
+ collect(),
+ tbl
+ )
+
+ # to confirm that the above expectation is actually testing what we think
it's
+ # testing, verify that expect_dplyr_equal() distinguishes between grouped and
+ # ungrouped tibbles
+ expect_error(
+ expect_dplyr_equal(
+ input %>%
+ group_by(chr) %>%
+ select(int, chr) %>%
+ (function(x) if (inherits(x, "tbl_df")) ungroup(x) else x) %>%
+ filter(int > 5) %>%
+ collect(),
+ tbl
+ )
Review comment:
I agree, this does feel a little strange to have this here, but I think
it's worth keeping it because it's reasonably easy to follow when it appears
here and it could conceivably prevent a future regression in the testing code.
--
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]