-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-14659: [R] Remove warning about factor conversion to string in if_else() #11794
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 <neal.p.richardson@gmail.com>
Co-authored-by: Ian Cook <ianmcook@gmail.com>
|
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)