westonpace commented on a change in pull request #11405:
URL: https://github.com/apache/arrow/pull/11405#discussion_r728401810
##########
File path: r/tests/testthat/test-dplyr-query.R
##########
@@ -226,14 +226,27 @@ test_that("head", {
test_that("arrange then head returns the right data (ARROW-14162)", {
expect_dplyr_equal(
input %>%
- arrange(mpg) %>%
+ # mpg has ties so we need to sort by two things to get deterministic
order
+ arrange(mpg, disp) %>%
head(4) %>%
collect(),
mtcars,
ignore_attr = "row.names"
)
})
+test_that("arrange then tail returns the right data", {
+ expect_dplyr_equal(
+ input %>%
+ # mpg has ties so we need to sort by two things to get deterministic
order
+ arrange(mpg, disp) %>%
+ tail(4) %>%
+ collect(),
+ mtcars,
+ ignore_attr = "row.names"
+ )
+})
+
test_that("tail", {
batch <- record_batch(tbl)
Review comment:
Can you add a test case for a bare `tail` with no `arrange`? I think it
might be treated as a `head` but I might not be following the logic right.
--
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]