Skip to content

Commit

Permalink
Update documentation for object walk change (#672)
Browse files Browse the repository at this point in the history
* Update documentation page

* Also condition one test file against much older versions

This addresses a failure in the test battery for 2.{11,12,13} and will have
no affect on current releases
  • Loading branch information
eddelbuettel authored Mar 15, 2024
1 parent 6024b71 commit ae82f51
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 20 deletions.
38 changes: 20 additions & 18 deletions inst/tinytest/test_attr.R
Original file line number Diff line number Diff line change
Expand Up @@ -94,24 +94,26 @@ uri <- tempfile()
if (dir.exists(uri)) unlink(uri, recursive=TRUE)
tiledb_array_create(uri, sch)
arr <- tiledb_array(uri, return_as="asis", extended=FALSE)
val <- arr[1:4][[1]]
## when fill value has been set, expect value
expect_equal(val, rep(42, 4))
expect_equal(tiledb_attribute_get_fill_value(attr), 42)

attr <- tiledb_attr("b", type = "CHAR", ncells = NA)
tiledb_attribute_set_fill_value(attr, "abc")
sch <- tiledb_array_schema(dom, attr)
uri <- tempfile()
if (dir.exists(uri)) unlink(uri, recursive=TRUE)
tiledb_array_create(uri, sch)
#arr <- tiledb_dense(uri)
#val <- arr[]
expect_equal(tiledb_attribute_get_fill_value(attr), "abc")

if (dir.exists(uri)) unlink(uri, recursive=TRUE)
if (tiledb_version(TRUE) > "2.14.0") {
val <- arr[1:4][[1]]
## when fill value has been set, expect value
expect_equal(val, rep(42, 4))
expect_equal(tiledb_attribute_get_fill_value(attr), 42)

attr <- tiledb_attr("b", type = "CHAR", ncells = NA)
tiledb_attribute_set_fill_value(attr, "abc")
sch <- tiledb_array_schema(dom, attr)

uri <- tempfile()
if (dir.exists(uri)) unlink(uri, recursive=TRUE)
tiledb_array_create(uri, sch)
#arr <- tiledb_dense(uri)
#val <- arr[]
expect_equal(tiledb_attribute_get_fill_value(attr), "abc")

if (dir.exists(uri)) unlink(uri, recursive=TRUE)
#})

}

## datetimes test (cf ex_aggdatetimes)
suppressMessages({
Expand Down Expand Up @@ -181,7 +183,6 @@ expect_true(tiledb_attribute_get_nullable(attrib))
attrib <- tiledb_attr("a", type = "FLOAT64", nullable=FALSE)
expect_false(tiledb_attribute_get_nullable(attrib))


uri <- tempfile()
if (dir.exists(uri)) unlink(uri, recursive=TRUE)

Expand Down Expand Up @@ -238,6 +239,7 @@ expect_equal(D, res)


## lower-level testing tiledb_query_set_buffer
if (tiledb_version(TRUE) < "2.14.0") exit_file("Remainder needs 2.14.* or later")
if (dir.exists(uri)) unlink(uri, recursive=TRUE)
v <- D[, "val"]
v[3] <- TRUE # without nullable for simplicity
Expand Down
8 changes: 6 additions & 2 deletions man/tiledb_object_walk.Rd

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

0 comments on commit ae82f51

Please sign in to comment.