Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[r] $set_metadata() does not update metadata if it already exists #2430

Open
mojaveazure opened this issue Apr 9, 2024 · 0 comments
Open
Labels
bug Something isn't working r-api

Comments

@mojaveazure
Copy link
Member

mojaveazure commented Apr 9, 2024

Describe the bug
$set_metadata() does not update array-level metadata if it already exists; instead, it runs to completion without any indication that the metadata was not updated

To Reproduce

> library(tiledbsoma)
> uri <- withr::local_tempdir()
> arr <- SOMASparseNDArrayCreate(uri, type = arrow::int32(), shape = c(20L, 10L))
> 
> (md <- list(
+   metadata_1 = bit64::as.integer64(0L),
+   metadata_2 = bit64::as.integer64(10L)
+ ))
$metadata_1
integer64
[1] 0

$metadata_2
integer64
[1] 10

> arr$set_metadata(md)
> 
> arr$reopen("READ")
> for (i in names(md)) {
+   print(arr$get_metadata(i))
+ }
integer64
[1] 0
integer64
[1] 10

> (md2 <- `[[<-`(md, "metadata_2", bit64::as.integer64(20L)))
$metadata_1
integer64
[1] 0

$metadata_2
integer64
[1] 20

> arr$reopen("WRITE")$set_metadata(md)
> arr$reopen("READ")
> for (i in names(md)) {
+   print(arr$get_metadata(i))
+ }
integer64
[1] 0
integer64
[1] 10

Versions (please complete the following information):

> tiledbsoma::show_package_versions()
tiledbsoma:    1.9.99.3
tiledb-r:      0.25.0
tiledb core:   2.21.1
libtiledbsoma: 2.21.1
R:             R version 4.2.3 (2023-03-15)
OS:            Ubuntu 22.04.4 LTS
@mojaveazure mojaveazure added bug Something isn't working r-api labels Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working r-api
Projects
None yet
Development

No branches or pull requests

1 participant