jonkeane commented on a change in pull request #8947:
URL: https://github.com/apache/arrow/pull/8947#discussion_r550266972
##########
File path: r/tests/testthat/test-dplyr.R
##########
@@ -133,6 +133,42 @@ test_that("filtering with expression", {
)
})
+test_that("filtering with arithmetic", {
+ expect_dplyr_equal(
+ input %>%
+ filter(dbl + 1 > 3) %>%
+ select(string = chr, int, dbl) %>%
+ collect(),
+ tbl
+ )
+
+ expect_dplyr_equal(
+ input %>%
+ filter(dbl / 2 > 3) %>%
+ select(string = chr, int, dbl) %>%
+ collect(),
+ tbl
+ )
+
+ expect_dplyr_equal(
+ input %>%
+ filter(dbl / 2L > 3) %>%
+ select(string = chr, int, dbl) %>%
+ collect(),
+ tbl
+ )
+
+ expect_dplyr_equal(
+ input %>%
+ filter(dbl %/% 2 > 3) %>%
+ select(string = chr, int, dbl) %>%
+ collect(),
+ tbl,
+ # TODO: why are record batched versions problematic?
Review comment:
_turns out_ this works in neither tables nor record batches (I
misunderstood the control flow of `expect_dplyr_equal()` that specifying
`skip_record_batch` would actually skip both record batch and table tests. I've
updated `expect_dplyr_equal()` to prevent that mistake/misunderstanding in the
future.
----------------------------------------------------------------
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:
[email protected]