You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by th...@apache.org on 2022/12/18 07:40:40 UTC

[arrow] branch master updated: GH-15009: [R] stringr 1.5.0 with the str_like function is already released (#15010)

This is an automated email from the ASF dual-hosted git repository.

thisisnic pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 6d3aec49d6 GH-15009: [R] stringr 1.5.0 with the str_like function is already released (#15010)
6d3aec49d6 is described below

commit 6d3aec49d697326f500f704b7283116b6b35f195
Author: eitsupi <50...@users.noreply.github.com>
AuthorDate: Sun Dec 18 16:40:33 2022 +0900

    GH-15009: [R] stringr 1.5.0 with the str_like function is already released (#15010)
    
    
    * Closes: #15009
    
    Authored-by: SHIMA Tatsuya <ts...@gmail.com>
    Signed-off-by: Nic Crane <th...@gmail.com>
---
 r/R/dplyr-funcs-doc.R                      |  2 +-
 r/R/dplyr-funcs-string.R                   |  3 +-
 r/data-raw/docgen.R                        |  4 +--
 r/man/acero.Rd                             |  2 +-
 r/tests/testthat/test-dplyr-funcs-string.R | 47 ++++++++++++------------------
 5 files changed, 22 insertions(+), 36 deletions(-)

diff --git a/r/R/dplyr-funcs-doc.R b/r/R/dplyr-funcs-doc.R
index 1798e9a96c..d97f87016c 100644
--- a/r/R/dplyr-funcs-doc.R
+++ b/r/R/dplyr-funcs-doc.R
@@ -315,7 +315,7 @@
 #' * [`str_dup()`][stringr::str_dup()]
 #' * [`str_ends()`][stringr::str_ends()]
 #' * [`str_length()`][stringr::str_length()]
-#' * `str_like()`: not yet in a released version of `stringr`, but it is supported in `arrow`
+#' * [`str_like()`][stringr::str_like()]
 #' * [`str_pad()`][stringr::str_pad()]
 #' * [`str_remove()`][stringr::str_remove()]
 #' * [`str_remove_all()`][stringr::str_remove_all()]
diff --git a/r/R/dplyr-funcs-string.R b/r/R/dplyr-funcs-string.R
index 16ad35148e..436083d9de 100644
--- a/r/R/dplyr-funcs-string.R
+++ b/r/R/dplyr-funcs-string.R
@@ -258,8 +258,7 @@ register_bindings_string_regex <- function() {
         string,
         options = list(pattern = pattern, ignore_case = ignore_case)
       )
-    },
-    notes = "not yet in a released version of `stringr`, but it is supported in `arrow`"
+    }
   )
 
   register_binding(
diff --git a/r/data-raw/docgen.R b/r/data-raw/docgen.R
index f5ffe595a1..97578b69bd 100644
--- a/r/data-raw/docgen.R
+++ b/r/data-raw/docgen.R
@@ -85,9 +85,7 @@ library(dplyr)
 library(purrr)
 
 # Functions that for whatever reason cause xref problems, so don't hyperlink
-do_not_link <- c(
-  "stringr::str_like" # Still only in the unreleased version
-)
+do_not_link <- c()
 
 package_notes <- list(
   stringr = "Pattern modifiers `coll()` and `boundary()` are not supported in any functions."
diff --git a/r/man/acero.Rd b/r/man/acero.Rd
index 9931d3df92..c865eba936 100644
--- a/r/man/acero.Rd
+++ b/r/man/acero.Rd
@@ -317,7 +317,7 @@ Pattern modifiers \code{coll()} and \code{boundary()} are not supported in any f
 \item \code{\link[stringr:str_dup]{str_dup()}}
 \item \code{\link[stringr:str_starts]{str_ends()}}
 \item \code{\link[stringr:str_length]{str_length()}}
-\item \code{str_like()}: not yet in a released version of \code{stringr}, but it is supported in \code{arrow}
+\item \code{\link[stringr:str_like]{str_like()}}
 \item \code{\link[stringr:str_pad]{str_pad()}}
 \item \code{\link[stringr:str_remove]{str_remove()}}
 \item \code{\link[stringr:str_remove]{str_remove_all()}}
diff --git a/r/tests/testthat/test-dplyr-funcs-string.R b/r/tests/testthat/test-dplyr-funcs-string.R
index 2e7931a49b..bb60a79daa 100644
--- a/r/tests/testthat/test-dplyr-funcs-string.R
+++ b/r/tests/testthat/test-dplyr-funcs-string.R
@@ -846,64 +846,53 @@ test_that("stri_reverse and arrow_ascii_reverse functions", {
 test_that("str_like", {
   df <- tibble(x = c("Foo and bar", "baz and qux and quux"))
 
-  # TODO: After new version of stringr with str_like has been released, update all
-  # these tests to use compare_dplyr_binding
-
   # No match - entire string
-  expect_equal(
-    df %>%
-      Table$create() %>%
+  compare_dplyr_binding(
+    .input %>%
       mutate(x = str_like(x, "baz")) %>%
       collect(),
-    tibble(x = c(FALSE, FALSE))
+    df
   )
   # with namespacing
-  expect_equal(
-    df %>%
-      Table$create() %>%
+  compare_dplyr_binding(
+    .input %>%
       mutate(x = stringr::str_like(x, "baz")) %>%
       collect(),
-    tibble(x = c(FALSE, FALSE))
+    df
   )
 
   # Match - entire string
-  expect_equal(
-    df %>%
-      Table$create() %>%
+  compare_dplyr_binding(
+    .input %>%
       mutate(x = str_like(x, "Foo and bar")) %>%
       collect(),
-    tibble(x = c(TRUE, FALSE))
+    df
   )
 
   # Wildcard
-  expect_equal(
-    df %>%
-      Table$create() %>%
+  compare_dplyr_binding(
+    .input %>%
       mutate(x = str_like(x, "f%", ignore_case = TRUE)) %>%
       collect(),
-    tibble(x = c(TRUE, FALSE))
+    df
   )
 
   # Ignore case
-  expect_equal(
-    df %>%
-      Table$create() %>%
+  compare_dplyr_binding(
+    .input %>%
       mutate(x = str_like(x, "f%", ignore_case = FALSE)) %>%
       collect(),
-    tibble(x = c(FALSE, FALSE))
+    df
   )
 
   # Single character
-  expect_equal(
-    df %>%
-      Table$create() %>%
+  compare_dplyr_binding(
+    .input %>%
       mutate(x = str_like(x, "_a%")) %>%
       collect(),
-    tibble(x = c(FALSE, TRUE))
+    df
   )
 
-  # TODO: remove this skip once a new version of stringr is released (maybe 1.5.0?)
-  skip_if_not("str_like" %in% getNamespaceExports("stringr"))
   compare_dplyr_binding(
     .input %>%
       mutate(x = str_like(x, "%baz%")) %>%