diff --git a/NEWS.md b/NEWS.md index f7d644f9d..093948344 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,8 @@ # dbplyr (development version) +* The `vars` argument of `translate_sql()` has been removed after it threw an + error for the last 7 years (@mgirlich). + * Added translation for `runif()` (@mgirlich, #1200). * `sql_random()` is now deprecated. It was used to power `slice_sample()` which diff --git a/R/backend-redshift.R b/R/backend-redshift.R index 40255f138..81e796f5a 100644 --- a/R/backend-redshift.R +++ b/R/backend-redshift.R @@ -140,4 +140,4 @@ supports_window_clause.Redshift <- function(con) { #' @export supports_window_clause.RedshiftConnection <- supports_window_clause.Redshift -utils::globalVariables(c("REGEXP_REPLACE", "LAG", "LEAD", "LISTAGG", "float")) +utils::globalVariables(c("REGEXP_REPLACE", "LAG", "LEAD", "LISTAGG", "float", "text")) diff --git a/R/translate-sql.R b/R/translate-sql.R index edbac411e..9947c372a 100644 --- a/R/translate-sql.R +++ b/R/translate-sql.R @@ -14,7 +14,6 @@ #' a list of already quoted objects. #' @param con An optional database connection to control the details of #' the translation. The default, `NULL`, generates ANSI SQL. -#' @param vars Deprecated. Now call [partial_eval()] directly. #' @param vars_group,vars_order,vars_frame Parameters used in the `OVER` #' expression of windowed functions. #' @param window Use `FALSE` to suppress generation of the `OVER` @@ -67,16 +66,10 @@ #' translate_sql(cumsum(mpg), vars_order = "mpg") translate_sql <- function(..., con = NULL, - vars = character(), vars_group = NULL, vars_order = NULL, vars_frame = NULL, window = TRUE) { - - if (!missing(vars)) { - cli_abort("{.arg vars} is deprecated. Please use {.fun partial_eval} directly.") - } - con <- con %||% sql_current_con() %||% simulate_dbi() translate_sql_( diff --git a/man/translate_sql.Rd b/man/translate_sql.Rd index 4436a1ed0..ae825e8c3 100644 --- a/man/translate_sql.Rd +++ b/man/translate_sql.Rd @@ -8,7 +8,6 @@ translate_sql( ..., con = NULL, - vars = character(), vars_group = NULL, vars_order = NULL, vars_frame = NULL, @@ -33,8 +32,6 @@ a list of already quoted objects.} \item{con}{An optional database connection to control the details of the translation. The default, \code{NULL}, generates ANSI SQL.} -\item{vars}{Deprecated. Now call \code{\link[=partial_eval]{partial_eval()}} directly.} - \item{vars_group, vars_order, vars_frame}{Parameters used in the \code{OVER} expression of windowed functions.} diff --git a/tests/testthat/_snaps/translate-sql.md b/tests/testthat/_snaps/translate-sql.md index a58e08f7c..852cc7698 100644 --- a/tests/testthat/_snaps/translate-sql.md +++ b/tests/testthat/_snaps/translate-sql.md @@ -35,11 +35,3 @@ Error: ! No known translation for `base::abbreviate()` -# vars is deprecated - - Code - translate_sql(sin(x), vars = c("x", "y")) - Condition - Error in `translate_sql()`: - ! `vars` is deprecated. Please use `partial_eval()` directly. - diff --git a/tests/testthat/test-translate-sql.R b/tests/testthat/test-translate-sql.R index 9ad928ac0..34e9cb6f0 100644 --- a/tests/testthat/test-translate-sql.R +++ b/tests/testthat/test-translate-sql.R @@ -68,10 +68,6 @@ test_that("magrittr pipe is translated", { expect_identical(translate_sql(1 %>% is.na()), translate_sql(is.na(1))) }) -test_that("vars is deprecated", { - expect_snapshot(error = TRUE, translate_sql(sin(x), vars = c("x", "y"))) -}) - test_that("user infix functions are translated", { expect_equal(translate_sql(x %like% y), sql("`x` like `y`")) })