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

   ### Describe the enhancement requested
   
   While PR https://github.com/apache/arrow/pull/39219 introduced an error 
message when the user passes pattern/replacement vectors with more than one 
element to `arrow_r_string_replace_function`, I'd like to suggest two 
enhancements. 
   
   * First and most fundamental: add a caveat on [this 
page](https://arrow.apache.org/docs/r/reference/acero.html#stringr), which, by 
the way, I use almost every day. On `r/R/dplyr-funcs-doc.R`: 
   ```
   #' * [`str_replace_all()`][stringr::str_replace_all()] Multiple replacements 
not yet supported,
   #' `pattern`/`replacement` must be a length 1 character vector
   ```
   
   * Second: make the `validation_error()` more explicit on what's happening. 
On `r/R/dplyr-funcs-string.R`:
   ```
   if (length(pattern) != 1) {
           validation_error(paste("Multiple replacements not supported,",
                                  "`pattern` must be a length 1 character 
vector"))
         }
         if (length(replacement) != 1) {
           validation_error(paste("Multiple replacements not supported,",
                                  "`replacement` must be a length 1 character 
vector"))
         }
   ```
   
   I'm about to submit a PR. But first, I would like to confirm some minor 
things: (1) does the test file update automatically when I run 
`devtools::test()`? (I can't test my changes right now), (2) is there any other 
test or change I should make before submitting the PR?
   
   ### 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