paleolimbot commented on code in PR #14277:
URL: https://github.com/apache/arrow/pull/14277#discussion_r984869012
##########
r/tests/testthat/test-Array.R:
##########
@@ -1172,6 +1172,43 @@ test_that("as_arrow_array() default method errors", {
)
})
+test_that("as_arrow_array() works for blob::blob()", {
+ skip_if_not_installed("blob")
+
+ expect_equal(
+ as_arrow_array(blob::blob(as.raw(1:5))),
Review Comment:
Good call - the binary converter apparently errored for `NULL` values in a
list. I checked that `expect_equal()` fails with a reasonable message if the
result is not an array, too:
``` r
library(arrow, warn.conflicts = FALSE)
testthat::local_edition(3)
testthat::expect_equal("not an array", arrow::Array$create(1:5))
#> Error: "not an array" (`actual`) not equal to arrow::Array$create(1:5)
(`expected`).
#>
#> `actual` is a character vector ('not an array')
#> `expected` is an R6 object of class <Array/ArrowDatum/ArrowObject>
```
<sup>Created on 2022-09-30 by the [reprex
package](https://reprex.tidyverse.org) (v2.0.1)</sup>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]