Skip to content

Commit

Permalink
feat: Only allow constant patterns in grepl()
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Apr 27, 2024
1 parent 79255a5 commit 9592e80
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions R/relational.R
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,13 @@ rel_translate <- function(
}

args <- map(as.list(expr[-1]), do_translate, in_window = in_window || window)

if (name == "grepl") {
if (!inherits(args[[1]], "relational_relexpr_constant")) {
cli::cli_abort("Only constant patterns are supported in {.code grepl()}")
}
}

fun <- relexpr_function(name, args)
if (window) {
partitions <- map(partition, relexpr_reference)
Expand Down

0 comments on commit 9592e80

Please sign in to comment.