[ 
https://issues.apache.org/jira/browse/ARROW-13799?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jonathan Keane resolved ARROW-13799.
------------------------------------
    Resolution: Fixed

Issue resolved by pull request 11417
[https://github.com/apache/arrow/pull/11417]

> [R] case_when error handling is capturing strings
> -------------------------------------------------
>
>                 Key: ARROW-13799
>                 URL: https://issues.apache.org/jira/browse/ARROW-13799
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: R
>            Reporter: Neal Richardson
>            Assignee: Dragoș Moldovan-Grünfeld
>            Priority: Critical
>              Labels: good-second-issue, pull-request-available
>             Fix For: 6.0.0
>
>          Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> This test, now unskipped since case_when supports string data, fails:
> {code}
>   expect_dplyr_equal(
>     input %>%
>       mutate(
>         cw = case_when(!(!(!(lgl))) ~ factor(chr), TRUE ~ fct)
>       ) %>%
>       collect(),
>     tbl
>   )
> {code}
> On inspection, it seems that `factor(chr)` is hitting `base::factor()`, which 
> tries to call `unique()` on the Expression and that fails with "unique() 
> applies only to vectors". This is getting propagated through to the resulting 
> dataset column because `arrow_eval()` returns a `try-error` on error and 
> `nse_funcs$case_when()` isn't checking for errors.
> cc [~icook]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to