Skip to content
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

[R] arrow R package: multiple replacement disclaimers for str_replace_all #45314

Open
baarthur opened this issue Jan 20, 2025 · 0 comments
Open

Comments

@baarthur
Copy link

baarthur commented Jan 20, 2025

Describe the enhancement requested

While PR #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, 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?, (3) on r/R/dplyr-funcs-doc.R I wrote "not supported yet". Will this feature be implemented in the future or should I change it to "not supported"?

Component(s)

R

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant