ianmcook commented on a change in pull request #11018:
URL: https://github.com/apache/arrow/pull/11018#discussion_r712646659



##########
File path: r/tests/testthat/test-dplyr-summarize.R
##########
@@ -251,6 +251,52 @@ test_that("Group by n_distinct() on dataset", {
   )
 })
 
+test_that("median()", {
+  # with groups
+  expect_dplyr_equal(
+    input %>%
+      group_by(some_grouping) %>%
+      summarize(
+        med_dbl = median(dbl),
+        med_int = median(int),
+        med_dbl_narmf = median(dbl, FALSE),
+        med_int_narmf = median(int, na.rm = F),
+        med_dbl_narmt = median(dbl, na.rm = TRUE),
+        med_int_narmt = median(int, T)
+      ) %>%
+      arrange(some_grouping) %>%
+      collect(),
+    tbl,
+    warning = "median\\(\\) currently returns an approximate median in Arrow"
+  )
+  # without groups, with na.rm = TRUE
+  expect_dplyr_equal(
+    input %>%
+      summarize(
+        med_dbl_narmt = median(dbl, na.rm = TRUE),
+        med_int_narmt = median(int, T)
+      ) %>%
+      collect(),
+    tbl,
+    warning = "median\\(\\) currently returns an approximate median in Arrow"
+  )
+
+  skip("Error on median(, na.rm = FALSE) with no groups (ARROW-14050)")

Review comment:
       I tried lots of fancy stuff to make this one case work without a C++ 
kernel change but I kept running into obstacles.




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


Reply via email to