diff --git a/apis/r/R/write_soma.R b/apis/r/R/write_soma.R index e1433458d6..44eabe3b4e 100644 --- a/apis/r/R/write_soma.R +++ b/apis/r/R/write_soma.R @@ -219,12 +219,32 @@ write_soma.data.frame <- function( choices = names(x), several.ok = TRUE ) + + # For index_column_name being soma_joinid -- this being the default + # -- set that domain slot to match the date. This will endow the + # dataframe with something users think of as a "shape". For the + # other slots, set the domain wide open. + # + domain <- NULL + if (.new_shape_feature_flag_is_enabled()) { + domain <- list() + for (index_column_name in index_column_names) { + if (index_column_name == "soma_joinid") { + domain[["soma_joinid"]] <- c(0, nrow(x) - 1) + } else { + domain[[index_column_name]] <- NULL + } + } + } + # Create the SOMADataFrame tbl <- arrow::arrow_table(x) sdf <- SOMADataFrameCreate( uri = uri, schema = tbl$schema, index_column_names = index_column_names, + # XXX TEMP + domain = domain, ingest_mode = ingest_mode, platform_config = platform_config, tiledbsoma_ctx = tiledbsoma_ctx diff --git a/apis/r/tests/testthat/test-write-soma-resume.R b/apis/r/tests/testthat/test-write-soma-resume.R index 4a2aaf517c..7b55a5449a 100644 --- a/apis/r/tests/testthat/test-write-soma-resume.R +++ b/apis/r/tests/testthat/test-write-soma-resume.R @@ -164,6 +164,7 @@ test_that("Resume-mode data frames", { } } + # TODO: resize if new shape feature-flag is enabled expect_s3_class( sdfc <- write_soma( co2,