ARROW-14659: [R] Remove warning about factor conversion to string in if_else()#11794
ARROW-14659: [R] Remove warning about factor conversion to string in if_else()#11794stephhazlitt wants to merge 5 commits intoapache:masterfrom
Conversation
Fails how? |
|
With the e.g. |
|
There is a similar test here, in which I solved the same failure by using: transmute(across(where(is.factor), ~ factor(.x, levels = c(...))))I think you can use that approach here too! |
|
Thanks @ianmcook, I replaced the |
Co-authored-by: Neal Richardson <[email protected]>
Co-authored-by: Ian Cook <[email protected]>
|
Benchmark runs are scheduled for baseline = 4913352 and contender = b83e6b0. b83e6b0 is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
This is my first PR contributing (or an attempt to contribute) to {arrow}.
This PR:
• removes
warn_typeswarning that factors are converted to strings, which is no longer true https://github.com/apache/arrow/blob/master/r/R/dplyr-functions.R#L911-L920• updates the test by removing the warning https://github.com/apache/arrow/blob/master/r/tests/testthat/test-dplyr-funcs-conditional.R#L130
however it does not remove themutate()in the test as suggested in the TODO, if removed the test fails?• [UPDATE] test includes a reset of the levels of all factor columns to pass, since Arrow if_else() kernel does not preserve unused factor levels (ARROW-14649)