etiennebacher opened a new issue, #46636:
URL: https://github.com/apache/arrow/issues/46636

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   When running the example below `foo.R` with `source("foo.R", local = 
new.env())`, the object `pattern` is not found by `arrow` while it is defined 
in this new environment. It seems `arrow` doesn't search the objects in the 
correct environment when using `case_when()`. 
   
   The same code using `dplyr` instead of `arrow` works fine. The `arrow` code 
also works fine interactively or with `source()` only. 
   
   `foo.R`:
   ```r
   library(arrow)
   library(dplyr)
   
   dat <- arrow_table(x = c("a", "b", "c"))
   pattern <- "a"
   dat |>
     mutate(x2 = case_when(pattern == "a" ~ "foo")) |>
     collect()
   ```
   
   ---
   
   R 4.5.0
   `arrow` 19.0.1.1
   
   ### Component(s)
   
   R


-- 
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: issues-unsubscr...@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to