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

refactor!: the ascii_case_insensitive argument must be named in $str$contains_any() #986

Merged
merged 4 commits into from
Mar 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
- Removed `<Series>$to_r_vector()` which was an old alias for
`<Series>$to_vector()` (#938).
- In `$str$contains()`, the arguments `literal` and `strict` should be named arguments (#982).
- In `$str$contains_any()`, the `ascii_case_insensitive` argument must be named (#986).
- In `$str$strptime()`, `$str$to_date()`, `$str$to_datetime()`, and
`$str$to_time()`, all arguments (except the first one) must be named (#939).
- In `$str$strptime()`, the argument `datatype` is renamed `dtype` (#939).
Expand Down
11 changes: 6 additions & 5 deletions R/expr__string.R
Original file line number Diff line number Diff line change
Expand Up @@ -874,13 +874,14 @@ ExprStr_reverse = function() {
#' Use the aho-corasick algorithm to find matches
#'
#' This function determines if any of the patterns find a match.
#' @param patterns String patterns to search. Can be an Expr.
#' @inherit ExprStr_contains params return
#' @param patterns Character vector or something can be coerced to strings [Expr][Expr_class]
#' of a valid regex pattern, compatible with the [regex crate](https://docs.rs/regex/latest/regex/).
#' @param ascii_case_insensitive Enable ASCII-aware case insensitive matching.
#' When this option is enabled, searching will be performed without respect to
#' case for ASCII letters (a-z and A-Z) only.
#'
#' @return Expr
#'
#' @seealso
#' - [`<Expr>$str$contains()`][ExprStr_contains]
#' @examples
#' df = pl$DataFrame(
#' lyrics = c(
Expand All @@ -893,7 +894,7 @@ ExprStr_reverse = function() {
#' df$with_columns(
#' contains_any = pl$col("lyrics")$str$contains_any(c("you", "me"))
#' )
ExprStr_contains_any = function(patterns, ascii_case_insensitive = FALSE) {
ExprStr_contains_any = function(patterns, ..., ascii_case_insensitive = FALSE) {
.pr$Expr$str_contains_any(self, patterns, ascii_case_insensitive) |>
unwrap("in str$contains_any():")
}
Expand Down
14 changes: 11 additions & 3 deletions man/ExprStr_contains_any.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading