Skip to content

Commit

Permalink
Temporarily re-admit as.data.frame=TRUE in tiledb_array() (#752)
Browse files Browse the repository at this point in the history
* Temporarily re-admit `as.data.frame=TRUE` in tiledb_array()

* Update NEWS.md [ci skip]
  • Loading branch information
eddelbuettel authored Sep 7, 2024
1 parent 63e1106 commit 56fd6aa
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: tiledb
Type: Package
Version: 0.29.0.6
Version: 0.29.0.7
Title: Modern Database Engine for Complex Data Based on Multi-Dimensional Arrays
Authors@R: c(person("TileDB, Inc.", role = c("aut", "cph")),
person("Dirk", "Eddelbuettel", email = "dirk@tiledb.com", role = "cre"))
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@

* Boolean arguments `as.data.frame`, `as.matrix` and `as.array` to the `tiledb_array()` accessor, deprecated in release 0.20.0 in July 2023 in favor of the more general `return_as="..."` form, have been removed. (#751)

## Deprecation

* As BioConductor package \pkg{TileDBArray} still relies on `as.data.frame` it was temporarily re-admitted as an argument. It is expected to be removed following the upcoming 3.20 release of BioConducto.r (#752)


# tiledb 0.29.0
Expand Down
12 changes: 11 additions & 1 deletion R/TileDBArray.R
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ setClass("tiledb_array",
#' \code{/dev/shm}) for writing out results buffers (for internal use / testing)
#' @param buffers An optional list with full pathnames of shared memory buffers to read data from
#' @param ctx optional tiledb_ctx
#' @param as.data.frame An optional deprecated alternative to \code{return_as="data.frame"} which has
#' been deprecated and removed, but is still used in one BioConductor package; this argument will be removed
#' once the updated package has been released.
#' @return tiledb_array object
#' @importFrom spdl set_level
#' @export
Expand All @@ -156,7 +159,8 @@ tiledb_array <- function(uri,
sil = list(),
dumpbuffers = character(),
buffers = list(),
ctx = tiledb_get_context()) {
ctx = tiledb_get_context(),
as.data.frame = FALSE) {
stopifnot("Argument 'ctx' must be a tiledb_ctx object" = is(ctx, "tiledb_ctx"),
"Argument 'uri' must be a string scalar" = !missing(uri) && is.scalar(uri, "character"),
"Argument 'matrix' (for 'return_as') cannot be selected for sparse arrays" =
Expand All @@ -170,6 +174,12 @@ tiledb_array <- function(uri,
array_xptr <- libtiledb_array_open(ctx@ptr, uri, query_type)
}

if (as.data.frame) {
## accommodating TileDBArray prior to BioConductor 3.20
.Deprecated(old="as.data.frame", new=r"(return_as="data.frame")")
return_as <- "data.frame"
}

if (length(timestamp_start) > 0) {
libtiledb_array_set_open_timestamp_start(array_xptr, timestamp_start)
}
Expand Down
7 changes: 6 additions & 1 deletion man/tiledb_array.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 56fd6aa

Please sign in to comment.