Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,6 @@ on_load({
run_on_load()
}

.onAttach <- function(lib, pkg) {
if (!exists(".__DEVTOOLS__", asNamespace("duckplyr"))) {
msg <- character()
suppressMessages(try_fetch(methods_overwrite(), message = function(cond) {
msg <<- c(msg, conditionMessage(cond))
zap()
}))
packageStartupMessage(msg)
}
}

.onDetach <- function(lib) {
if (!exists(".__DEVTOOLS__", asNamespace("duckplyr"))) {
msg <- character()
suppressMessages(try_fetch(methods_restore(), message = function(cond) {
msg <<- c(msg, conditionMessage(cond))
zap()
}))
packageStartupMessage(msg)
}
}

# Avoid R CMD check warning
dummy <- function() {
memoise::memoise()
Expand Down
7 changes: 3 additions & 4 deletions vignettes/developers.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@ conflict_prefer("filter", "dplyr")

## Introduction

The default behavior of duckplyr is to enable itself for all data frames in the session.
This happens when the package is attached with `library(duckplyr)`, or by calling `methods_overwrite()`.
To enable duckplyr for individual data frames instead of session-wide, it is sufficient to prefix all calls to duckplyr functions with `duckplyr::` and not attach the package.
Alternatively, `methods_restore()` can be called to undo the session-wide overwrite after `library(duckplyr)`.
As of duckplyr 1.2.0, duckplyr will no longer automatically override dplyr methods for all data frames in the session when the package is attached with `library(duckplyr)`.
This change makes it easier to use duckplyr alongside dplyr and other packages that depend on dplyr.
You can still enable duckplyr for all data frames in the session by calling `methods_overwrite()` after attaching the package, and undo the session-wide overwrite using `methods_restore()`.

## External data with explicit qualification

Expand Down
Loading