From 11be45b393bb02f081f00c6bf152bc4c362bbb3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rasmus=20Skytte=20Randl=C3=B8v?= Date: Thu, 4 Apr 2024 09:12:45 +0200 Subject: [PATCH 1/3] feat(DESCRIPTION): Require duckdb >= 0.10.1 --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 71f1ca05..b30ef032 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -43,7 +43,7 @@ Imports: Suggests: callr, conflicted, - duckdb, + duckdb (>= 0.10.1), ggplot2, here, jsonlite, From 98d006024287b3fd519fe5dfe6ee2bd911c412fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rasmus=20Skytte=20Randl=C3=B8v?= Date: Thu, 4 Apr 2024 09:13:15 +0200 Subject: [PATCH 2/3] feat: Remove unnecessary shutdown = TRUE argument --- R/connection.R | 2 +- data-raw/benchmark.R | 2 +- tests/testthat/setup.R | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/R/connection.R b/R/connection.R index bf329ed4..dfcaf09f 100644 --- a/R/connection.R +++ b/R/connection.R @@ -245,5 +245,5 @@ close_connection <- function(conn) { # Check arguments checkmate::assert_class(conn, "DBIConnection") - DBI::dbDisconnect(conn, shutdown = TRUE) + DBI::dbDisconnect(conn) } diff --git a/data-raw/benchmark.R b/data-raw/benchmark.R index 3e0f2a5a..a468c02c 100644 --- a/data-raw/benchmark.R +++ b/data-raw/benchmark.R @@ -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) diff --git a/tests/testthat/setup.R b/tests/testthat/setup.R index d57b3770..b25546e8 100644 --- a/tests/testthat/setup.R +++ b/tests/testthat/setup.R @@ -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) @@ -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) } @@ -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) } From bc071a15668e00aa2af9ccc0d8c1aa97cb65e1ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rasmus=20Skytte=20Randl=C3=B8v?= Date: Fri, 4 Oct 2024 10:55:40 +0200 Subject: [PATCH 3/3] feat(helper-setup): Remove unnecessary duckdb_shutdown calls --- tests/testthat/helper-setup.R | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/testthat/helper-setup.R b/tests/testthat/helper-setup.R index e75a8936..e52537d2 100644 --- a/tests/testthat/helper-setup.R +++ b/tests/testthat/helper-setup.R @@ -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", "#####",