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

Add setOldClass() calls #453

Merged
merged 4 commits into from May 15, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS.md
@@ -1,5 +1,7 @@
# dbplyr (development version)

* Added `setOldClass()` calls for `"ident"` and `"ident_q"` classes for compatibility with dplyr 1.0.0 (#448, @krlmlr).

* `str_detect()` translation for Postgres uses same argument names as stringr,
and gains a `negate` argument (#444).

Expand Down
2 changes: 0 additions & 2 deletions R/ident.R
Expand Up @@ -26,15 +26,13 @@ ident <- function(...) {
x <- c_character(...)
structure(x, class = c("ident", "character"))
}
setOldClass(c("ident", "character"), ident())

#' @export
#' @rdname ident
ident_q <- function(...) {
x <- c_character(...)
structure(x, class = c("ident_q", "ident", "character"))
}
# setOldClass(c("ident_q", "ident", "character"), ident_q())

#' @export
print.ident <- function(x, ...) cat(format(x, ...), sep = "\n")
Expand Down
8 changes: 8 additions & 0 deletions R/zzz.R
Expand Up @@ -17,6 +17,14 @@
if (!methods::isClass("sql")) {
setOldClass(c("sql", "character"), sql())
}

if (!methods::isClass("ident")) {
setOldClass(c("ident", "sql", "character"), ident())
}

if (!methods::isClass("ident_q")) {
setOldClass(c("ident_q", "ident", "sql", "character"), ident_q())
}
}

register_s3_method <- function(pkg, generic, class, fun = NULL) {
Expand Down