Skip to content

Commit

Permalink
unsupported_arg_error -> dbplyr_error_unsupported_arg
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpcouch committed Oct 31, 2024
1 parent 9c5355c commit ab5ca80
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion R/utils-check.R
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ check_unsupported_arg <- function(x,

msg <- c(msg, i = allow_msg)
}
cli_abort(msg, call = call, class = "unsupported_arg_error")
cli_abort(msg, call = call, class = "dbplyr_error_unsupported_arg")
}

stop_unsupported_function <- function(f, ..., with = NULL, call = caller_env()) {
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/rows.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
(expect_error(rows_insert(lf, lf, by = "x", conflict = "error", in_place = FALSE))
)
Output
<error/unsupported_arg_error>
<error/dbplyr_error_unsupported_arg>
Error in `rows_insert()`:
! `conflict = "error"` isn't supported on database backends.
i It must be "ignore" instead.
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/_snaps/translate-sql-conditional.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@
(expect_error(test_translate_sql(case_when(x == 1L ~ "yes", .ptype = character())))
)
Output
<error/unsupported_arg_error>
<error/dbplyr_error_unsupported_arg>
Error in `case_when()`:
! Argument `.ptype` isn't supported on database backends.
Code
(expect_error(test_translate_sql(case_when(x == 1L ~ "yes", .size = 1))))
Output
<error/unsupported_arg_error>
<error/dbplyr_error_unsupported_arg>
Error in `case_when()`:
! Argument `.size` isn't supported on database backends.

Expand Down Expand Up @@ -122,7 +122,7 @@
Code
(expect_error(test_translate_sql(case_match(x, 1 ~ 1, .ptype = integer()))))
Output
<error/unsupported_arg_error>
<error/dbplyr_error_unsupported_arg>
Error in `case_match()`:
! Argument `.ptype` isn't supported on database backends.

Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/verb-pivot-wider.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
Code
(expect_error(tidyr::pivot_wider(df, id_expand = TRUE)))
Output
<error/unsupported_arg_error>
<error/dbplyr_error_unsupported_arg>
Error in `tidyr::pivot_wider()`:
! `id_expand = TRUE` isn't supported on database backends.
i It must be FALSE instead.
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-backend-snowflake.R
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ test_that("custom lubridate functions translated correctly", {
expect_equal(test_translate_sql(quarter(x, with_year = TRUE)), sql("(EXTRACT('year', `x`) || '.' || EXTRACT('quarter', `x`))"))
expect_error(
test_translate_sql(quarter(x, fiscal_start = 2)),
class = "unsupported_arg_error"
class = "dbplyr_error_unsupported_arg"
)
expect_equal(test_translate_sql(isoyear(x)), sql("EXTRACT('year', `x`)"))

Expand Down

0 comments on commit ab5ca80

Please sign in to comment.