Skip to content

Commit bbb2a6c

Browse files
committed
[r] Replace tiledb-r with SOMA for test helper
Replace tiledb-r with SOMA for test helper function to create an empty sparse nd-array [SC-64301](https://app.shortcut.com/tiledb-inc/story/64301) continues work for #2406
1 parent a031e2b commit bbb2a6c

File tree

1 file changed

+7
-23
lines changed

1 file changed

+7
-23
lines changed

apis/r/tests/testthat/helper-test-soma-objects.R

+7-23
Original file line numberDiff line numberDiff line change
@@ -327,30 +327,14 @@ create_and_populate_32bit_sparse_nd_array <- function(uri) {
327327
soma_data = c(1L, 2L, 3L)
328328
)
329329

330-
tdb_dims <- mapply(
331-
tiledb::tiledb_dim,
332-
name = c("soma_dim_0", "soma_dim_1"),
333-
MoreArgs = list(
334-
domain = c(bit64::as.integer64(0), 2^31 - 1),
335-
tile = bit64::as.integer64(2),
336-
type = "INT64"
337-
),
338-
SIMPLIFY = FALSE
339-
)
340-
341-
tdb_attr <- tiledb::tiledb_attr(
342-
name = "soma_data",
343-
type = "INT32",
330+
arr <- SOMASparseNDArrayCreate(
331+
uri = uri,
332+
type = arrow::int32(),
333+
shape = rep_len(2 ^ 31, length.out = 2L)
344334
)
335+
on.exit(arr$close(), add = TRUE, after = FALSE)
345336

346-
tdb_schema <- tiledb::tiledb_array_schema(
347-
domain = tiledb::tiledb_domain(tdb_dims),
348-
attrs = tdb_attr,
349-
sparse = TRUE
350-
)
337+
arr$.write_coordinates(df)
351338

352-
tiledb::tiledb_array_create(uri, schema = tdb_schema)
353-
arr <- tiledb::tiledb_array(uri, "WRITE")
354-
arr[] <- df
355-
uri
339+
return(uri)
356340
}

0 commit comments

Comments
 (0)