Skip to content

Commit

Permalink
change overwrite default
Browse files Browse the repository at this point in the history
  • Loading branch information
ablack3 committed Dec 11, 2023
1 parent 53b42ea commit c41858a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions R/compute.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# @return A dplyr reference to the newly created table
#
# internal function
.computePermanent <- function(x, name, schema = NULL, overwrite = FALSE) {
.computePermanent <- function(x, name, schema = NULL, overwrite = TRUE) {
checkmate::assertCharacter(schema, min.len = 1, max.len = 2, null.ok = TRUE)
schema <- unname(schema)
checkmate::assertCharacter(name, len = 1)
Expand Down Expand Up @@ -154,8 +154,8 @@ unique_table_name <- uniqueTableName
#' @param temporary Should the table be temporary: TRUE (default) or FALSE
#' @param schema The schema where the table should be created. Ignored if
#' temporary = TRUE.
#' @param overwrite Should the table be overwritten if it already exists: TRUE
#' or FALSE (default) Ignored if temporary = TRUE.
#' @param overwrite Should the table be overwritten if it already exists: TRUE (default)
#' or FALSE Ignored if temporary = TRUE.
#' @param ... Further arguments passed on the `dplyr::compute`
#'
#' @return A `dplyr::tbl()` reference to the newly created table.
Expand Down Expand Up @@ -184,7 +184,7 @@ computeQuery <- function(x,
name = uniqueTableName(),
temporary = TRUE,
schema = NULL,
overwrite = FALSE,
overwrite = TRUE,
...) {

if (is.data.frame(x) || (methods::is(x, "Table") && methods::is(x, "ArrowTabular"))) {
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-db-compute.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ test_compute_query <- function(con, cdm_schema, write_schema) {
expect_error({
cdm$vocabulary %>%
dplyr::filter(vocabulary_id %in% c("ATC", "CPT4")) %>%
computeQuery(new_table_name, schema = write_schema, temporary = FALSE)},
computeQuery(new_table_name, schema = write_schema, temporary = FALSE, overwrite = FALSE)},
"already exists")

expect_no_error({
Expand Down

0 comments on commit c41858a

Please sign in to comment.