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

Remove shutdown = TRUE argument for DuckDB #154

Merged
merged 3 commits into from
Oct 4, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Imports:
Suggests:
callr,
conflicted,
duckdb,
duckdb (>= 0.10.1),
ggplot2,
here,
jsonlite,
Expand Down
2 changes: 1 addition & 1 deletion R/connection.R
Original file line number Diff line number Diff line change
Expand Up @@ -245,5 +245,5 @@ close_connection <- function(conn) {
# Check arguments
checkmate::assert_class(conn, "DBIConnection")

DBI::dbDisconnect(conn, shutdown = TRUE)
DBI::dbDisconnect(conn)
}
2 changes: 1 addition & 1 deletion data-raw/benchmark.R
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ if (identical(Sys.getenv("CI"), "true") && identical(Sys.getenv("BACKEND"), ""))
}

# Clean up
purrr::walk(conns, ~ DBI::dbDisconnect(., shutdown = TRUE))
purrr::walk(conns, DBI::dbDisconnect)
})

detach("package:SCDB", unload = TRUE)
Expand Down
5 changes: 0 additions & 5 deletions tests/testthat/helper-setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,6 @@ get_test_conns <- function() {
purrr::walk2(test_conns, names(test_conns),
\(conn, conn_name) purrr::walk(purrr::pluck(conn_post_connect, conn_name), ~ DBI::dbExecute(conn, .)))

# Shutdown drivers that needs it
drivers |>
purrr::keep(~ inherits(., "duckdb_driver")) |>
purrr::walk(~ duckdb::duckdb_shutdown(.))

# Inform the user about the tested back ends:
msg <- paste(sep = "\n",
"#####",
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ for (conn_id in seq_along(conns)) {
coll$push(glue::glue("Tests require the schema 'test.one' to exist in connection ({names(conns)[[conn_id]]})."))
}

DBI::dbDisconnect(conn, shutdown = TRUE)
DBI::dbDisconnect(conn)
}
checkmate::reportAssertions(coll)

Expand Down Expand Up @@ -53,7 +53,7 @@ for (conn in get_test_conns()) {
until_ts = as.POSIXct(NA)),
name = id("__mtcars_historical", conn), temporary = FALSE, overwrite = TRUE)

DBI::dbDisconnect(conn, shutdown = TRUE)
DBI::dbDisconnect(conn)
}


Expand All @@ -68,5 +68,5 @@ connection_clean_up <- function(conn) {
if (nrow(dplyr::filter(get_tables(conn, show_temporary = TRUE), stringr::str_detect(.data$table, "^#?dbplyr_")))) {
warning("Temporary dbplyr tables ('dbplyr_###') are not cleaned up!")
}
DBI::dbDisconnect(conn, shutdown = TRUE)
DBI::dbDisconnect(conn)
}
Loading