nealrichardson commented on a change in pull request #9423:
URL: https://github.com/apache/arrow/pull/9423#discussion_r575584575



##########
File path: r/tests/testthat/test-dplyr.R
##########
@@ -256,6 +262,29 @@ test_that("filter() with %in%", {
   )
 })
 
+test_that("filter() with string ops", {
+  expect_dplyr_equal(
+    input %>%
+      filter(dbl > 2, toupper(chr) %in% c("D", "F")) %>%
+      collect(),
+    tbl
+  )

Review comment:
       I looked into this. You can't just define `as.character` in the test 
because you need to replace the one that `toupper` calls. You can't use 
`testthat::with_mock` to mock base functions anymore, and my other hack of 
using `trace` to insert a crash seems to crash too many things (presumably 
legitimate places where as.character gets called elsewhere in the dplyr code). 
`mockery` might allow this more targeted but I haven't had great success 
setting it up before; there are other ways we could instrument our code to make 
sure the Arrow function is called, but I'm not sure it's worth it. It 
_definitely_ won't work if you called `toupper` on a Dataset expression, so we 
get some related test coverage there.




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


Reply via email to