Skip to content

Commit da72c64

Browse files
jp-darkaaronwolen
andauthored
[python/r] Update R version and changelogs (#4387) (#4390)
* Update Python history * Update R NEWS and version number * Prevent eval of `what` args in lifecycle::deprecate_* calls Wrap `what` in `I()` to prevent unintended evaluation of R6 objects. For example: lifecycle::deprecate_warn(what="SOMAExperiment$tiledbsoma_ctx", when="2.3.0") * Remove internal calls to deprecated self$tiledbsoma_ctx SOMACollectionBase was calling self$tiledbsoma_ctx, which triggered the deprecation warning from the active bunding. * Suppress deprecation warnings in SOMATileDBContext tests Added `withr::local_options(lifecycle_verbosity = "quiet")` to suppress deprecation warnings since we're knowingly testing the deprecated class. * Update iterated reader tests to leverage new set_default_context() * Update deprecation handling for `set_data_type()` - Adjusted tests for `set_data_type()` to reflect deprecation policy --------- (cherry picked from commit 60406df) Co-authored-by: Aaron Wolen <aaron@wolen.com>
1 parent 93f0295 commit da72c64

File tree

7 files changed

+26
-11
lines changed

7 files changed

+26
-11
lines changed

apis/r/DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Description: Interface for working with 'TileDB'-based Stack of Matrices,
66
like those commonly used for single cell data analysis. It is documented at
77
<https://github.com/single-cell-data>; a formal specification available is at
88
<https://github.com/single-cell-data/SOMA/blob/main/abstract_specification.md>.
9-
Version: 2.2.0
9+
Version: 2.3.0
1010
Authors@R: c(
1111
person(given = "Paul", family = "Hoffman",
1212
role = c("cre", "aut"), email = "tiledb-r@tiledb.com",

apis/r/NEWS.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
- Added `SOMAContext$is_tiledbv2()` and `SOMAContext$is_tiledbv3()` methods to check the data protocol for a given URI.
88
- Added Carrara (TileDB v3) support for collection classes. Child objects created at nested Carrara URIs are automatically registered with their parent collection.
99

10+
## Changed
11+
12+
- `SOMACollectionBase$set()` now throws an `unsupportedOperationError` for Carrara URIs since the Carrara data model does not support adding external objects to collections. Use `add_new_*` methods instead.
13+
- Reduced some internal diagnostic logging from INFO to DEBUG level.
14+
1015
## Deprecated
1116

1217
- The function `soma_context` is deprecated. Use class `SOMAContext` instead. ([#4355](https://github.com/single-cell-data/TileDB-SOMA/pull/4355))
@@ -16,9 +21,9 @@
1621
## Fixed
1722

1823
- Fixed `SOMACollectionBase$set()` allowing replacement of existing members after reopening the collection. The method now consistently rejects duplicate keys both within the same session and across sessions. ([#4378](https://github.com/single-cell-data/TileDB-SOMA/pull/4378))
24+
- `SOMATileDBContext` no longer replaces `sm.mem.reader.sparse_global_order.ratio_array_data` when set in the input config. ([#4355](https://github.com/single-cell-data/TileDB-SOMA/pull/4355))
1925
- Fixed `SOMACollectionBase$remove()` incorrectly accessing `self$mode` instead of calling `self$mode()`.
2026
- Fixed collection member cache not properly handling DELETE mode.
21-
- `SOMATileDBContext` no longer replaces `sm.mem.reader.sparse_global_order.ratio_array_data` when set in the input config. ([#4355](https://github.com/single-cell-data/TileDB-SOMA/pull/4355))
2227

2328
# tiledbsoma 2.2.0
2429

apis/r/R/SOMACollectionBase.R

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,6 @@ SOMACollectionBase <- R6::R6Class(
430430
index_column_names = index_column_names,
431431
domain = domain,
432432
platform_config = platform_config %||% self$platform_config,
433-
tiledbsoma_ctx = self$tiledbsoma_ctx,
434433
context = self$context,
435434
tiledb_timestamp = self$tiledb_timestamp # Cached value from $new()/SOMACollectionOpen
436435
)
@@ -459,7 +458,6 @@ SOMACollectionBase <- R6::R6Class(
459458
type = type,
460459
shape = shape,
461460
platform_config = platform_config %||% self$platform_config,
462-
tiledbsoma_ctx = self$tiledbsoma_ctx,
463461
context = self$context,
464462
tiledb_timestamp = self$tiledb_timestamp
465463
)
@@ -493,7 +491,6 @@ SOMACollectionBase <- R6::R6Class(
493491
type = type,
494492
shape = shape,
495493
platform_config = platform_config %||% self$platform_config,
496-
tiledbsoma_ctx = self$tiledbsoma_ctx,
497494
context = self$context,
498495
tiledb_timestamp = self$tiledb_timestamp # Cached value from $new()/SOMACollectionOpen
499496
)
@@ -816,7 +813,6 @@ SOMACollectionBase <- R6::R6Class(
816813
uri,
817814
mode = self$mode(),
818815
platform_config = self$platform_config,
819-
tiledbsoma_ctx = self$tiledbsoma_ctx,
820816
context = self$context,
821817
tiledb_timestamp = self$tiledb_timestamp
822818
))

apis/r/R/utils-deprecations.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@
5656
EXPR = .deprecation_stage(when = when) %||% "future",
5757
defunct = lifecycle::deprecate_stop(
5858
when = as.character(when),
59-
what = what,
59+
what = I(what),
6060
with = with,
6161
details = details,
6262
env = env
6363
),
6464
deprecate = lifecycle::deprecate_warn(
6565
when = as.character(when),
66-
what = what,
66+
what = I(what),
6767
with = with,
6868
details = details,
6969
# lifecycle tries to be clever when determining when to warn; however,

apis/r/tests/testthat/test-03-SOMATileDBContext.R

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
test_that("SOMATileDBContext mechanics", {
22
skip_if(!extended_tests())
3+
# Suppress deprecation warnings since we're testing the deprecated class here
4+
withr::local_options(lifecycle_verbosity = "quiet")
5+
36
ctx <- SOMATileDBContext$new()
47
expect_true(length(ctx) >= 1L)
58
expect_identical(length(ctx), ctx$length())
@@ -15,6 +18,8 @@ test_that("SOMATileDBContext mechanics", {
1518

1619
test_that("SOMATileDBContext SOMA mechanics", {
1720
skip_if(!extended_tests())
21+
withr::local_options(lifecycle_verbosity = "quiet")
22+
1823
ctx <- SOMATileDBContext$new()
1924
ntiledb <- length(x = ctx$.__enclos_env__$private$.tiledb_ctx_names())
2025
expect_no_condition(ctx$set("member_uris_are_relative", TRUE))
@@ -47,6 +52,8 @@ test_that("SOMATileDBContext SOMA mechanics", {
4752

4853
test_that("SOMATileDBContext TileDB mechanics", {
4954
skip_if(!extended_tests())
55+
withr::local_options(lifecycle_verbosity = "quiet")
56+
5057
ctx <- SOMATileDBContext$new()
5158
tiledb_names <- ctx$.__enclos_env__$private$.tiledb_ctx_names()
5259
expect_identical(ctx$keys(), tiledb_names)
@@ -71,6 +78,8 @@ test_that("SOMATileDBContext TileDB mechanics", {
7178

7279
test_that("SOMATileDBContext SOMA + TileDB mechanics", {
7380
skip_if(!extended_tests())
81+
withr::local_options(lifecycle_verbosity = "quiet")
82+
7483
ctx <- SOMATileDBContext$new()
7584
tiledb_names <- ctx$.__enclos_env__$private$.tiledb_ctx_names()
7685
expect_error(

apis/r/tests/testthat/test-06-SOMADenseNDArray.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,12 @@ test_that("`SOMADenseNDArray$set_data_type()` deprecations", {
326326
}
327327
)
328328

329-
if (utils::packageVersion("tiledbsoma") >= "2.1.0") {
329+
# Per POLICIES.md:
330+
# deprecated in 2.1.0, defunct after two minor releases (2.3.0)
331+
pkg_version <- utils::packageVersion("tiledbsoma")
332+
if (pkg_version >= "2.3.0") {
333+
lifecycle::expect_defunct(dnda$set_data_type(arrow::int16()))
334+
} else if (pkg_version >= "2.1.0") {
330335
lifecycle::expect_deprecated(dnda$set_data_type(arrow::int16()))
331336
}
332337
})

apis/r/tests/testthat/test-10-SOMAArrayReader-Iterated.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ test_that("Iterated Interface from SOMA Classes", {
108108

109109
# The read_complete et al. in this test case are designed to be verified
110110
# against 16MB buffer size, and the particular provided input dataset.
111-
# The soma_context() is cached at the package level and passed that way
111+
# The context is cached at the package level and passed that way
112112
# to the SOMADataFrame and SOMASparseNDArray classes
113-
context_handle <- soma_context(c(soma.init_buffer_bytes = as.character(16777216)))
113+
set_default_context(c(soma.init_buffer_bytes = as.character(16777216)), replace = TRUE)
114114

115115
for (tc in test_cases) {
116116
sdf <- switch(

0 commit comments

Comments
 (0)