Skip to content

Commit

Permalink
[r] Test for conversion of axis query index
Browse files Browse the repository at this point in the history
  • Loading branch information
eddelbuettel committed Jul 18, 2023
1 parent dc8a6c9 commit 3e5568c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions apis/r/tests/testthat/test-SOMAAxisQuery.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,15 @@ test_that("SOMAAxisQuery", {
SOMAAxisQuery$new(coords = list(foo = letters)),
"'coords' must be a list of numeric vectors"
)

## check for numeric arguments becoming integer64 (issue #1537)
expt <- load_dataset("soma-exp-pbmc-small")
intq <- SOMAAxisQuery$new(coords = 1:2) # int as : operator creates ints
numq <- SOMAAxisQuery$new(coords = c(1, 2)) # numeric
expt_query <- SOMAExperimentAxisQuery$new(expt, "RNA", var_query = intq, obs_query = numq)
op <- getOption("arrow.int64_downcast")
options("arrow.int64_downcast"=FALSE) # else it becomes int
expect_true(inherits(expt_query$var_joinids()$as_vector(), "integer64"))
expect_true(inherits(expt_query$obs_joinids()$as_vector(), "integer64"))
options("arrow.int64_downcast"=op)
})

0 comments on commit 3e5568c

Please sign in to comment.