Skip to content

Commit

Permalink
proofread error message
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpcouch committed Oct 31, 2024
1 parent a8198be commit 9ca8c48
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions R/backend-.R
Original file line number Diff line number Diff line change
Expand Up @@ -280,13 +280,13 @@ base_scalar <- sql_translator(
str_trim = sql_str_trim,
str_c = sql_paste(""),
str_sub = sql_str_sub("SUBSTR"),
# https://docs.getdbt.com/sql-reference/like is typically case sensitive
# https://docs.getdbt.com/sql-reference/like is typically case sensitive (#1490)
str_like = function(string, pattern, ignore_case = FALSE) {
if (isTRUE(ignore_case)) {
cli_abort(c(
"Backend does not support case insensitve {.fn str_like}.",
i = "Set ignore_case = FALSE for case sensitive match.",
i = "Or use `tolower()` on both arguments to achieve a case insensitive match."
"Backend does not support case insensitive {.fn str_like}.",
i = "Set {.code ignore_case = FALSE} for case sensitive match.",
i = "Use {.fn tolower} on both arguments to achieve a case insensitive match."
))
} else {
sql_expr(!!string %LIKE% !!pattern)
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/_snaps/backend-.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@
test_translate_sql(str_like(x, "abc", ignore_case = TRUE))
Condition
Error in `str_like()`:
! Backend does not support case insensitve `str_like()`.
i Set ignore_case = FALSE for case sensitive match.
i Or use `tolower()` on both arguments to achieve a case insensitive match.
! Backend does not support case insensitive `str_like()`.
i Set `ignore_case = FALSE` for case sensitive match.
i Use `tolower()` on both arguments to achieve a case insensitive match.

# default raw escapes translated correctly

Expand Down

0 comments on commit 9ca8c48

Please sign in to comment.