From 941a5e7a920bf242163e235d66ef6cedbdb84f32 Mon Sep 17 00:00:00 2001 From: schuemie Date: Tue, 4 Jun 2024 13:42:46 +0200 Subject: [PATCH] Fix `isAndromedaTable()` when table belongs to descendant of Andromda. Fixes #64 --- DESCRIPTION | 2 +- NEWS.md | 8 ++++++++ R/Object.R | 7 +------ tests/testthat/test-object.R | 6 ------ 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 4a32ae2..9c841f7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: Andromeda Type: Package Title: Asynchronous Disk-Based Representation of Massive Data -Version: 0.6.6 +Version: 0.6.7 Date: 2024-03-21 Authors@R: c( person("Adam", "Black", , "black@ohdsi.org", role = c("aut")), diff --git a/NEWS.md b/NEWS.md index 01ea475..a8cc1e6 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,11 @@ +Andromeda 0.6.7 +=============== + +Bugfixes + +- Fix `isAndromedaTable()` when table belongs to descendant of Andromda. + + Andromeda 0.6.6 =============== diff --git a/R/Object.R b/R/Object.R index ebb6c0e..2459e3e 100644 --- a/R/Object.R +++ b/R/Object.R @@ -466,10 +466,5 @@ checkIfValid <- function(x) { #' close(andr) #' } isAndromedaTable <- function(tbl) { - return( - inherits(tbl, "FileSystemDataset") || - inherits(tbl, "arrow_dplyr_query") || - inherits(tbl, "tbl_Andromeda") || - inherits(tbl, "tbl_SQLiteConnection") - ) + return(inherits(tbl, "tbl") && inherits(dbplyr::remote_con(tbl), "Andromeda")) } diff --git a/tests/testthat/test-object.R b/tests/testthat/test-object.R index f21ccf4..82640aa 100644 --- a/tests/testthat/test-object.R +++ b/tests/testthat/test-object.R @@ -187,12 +187,6 @@ test_that("Get/set Andromeda table/column names works.", { }) test_that("isAndromedaTable sqlite version", { - con <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") - DBI::dbWriteTable(con, "cars", cars) - db <- dplyr::tbl(con, "cars") - expect_true(isAndromedaTable(db)) - expect_true(isAndromedaTable(dplyr::mutate(db, a = 1))) - a <- andromeda(cars = cars) class(a$cars) expect_true(isAndromedaTable(a$cars))