nealrichardson commented on a change in pull request #7514:
URL: https://github.com/apache/arrow/pull/7514#discussion_r446237067



##########
File path: r/tests/testthat/test-Array.R
##########
@@ -18,16 +18,16 @@
 context("Array")
 
 expect_array_roundtrip <- function(x, type) {
-  a <- Array$create(x)
+  a <- Array$create(x, type = type)

Review comment:
       I don't think we want to do this in general because it means we're not 
testing the automatic type detection code. Instead, how about changing the 
function signature to:
   
   ```r
   expect_array_roundtrip <- function(x, type, as = NULL) {
   ```
   and then here
   
   ```suggestion
     a <- Array$create(x, type = as)
   ```
   
   then adding changing the Large* tests to pass `as` as well.

##########
File path: r/tests/testthat/test-Array.R
##########
@@ -36,10 +36,10 @@ expect_array_roundtrip <- function(x, type) {
     x_sliced <- x[-1]
     expect_type_equal(a_sliced$type, type)
     expect_identical(length(a_sliced), length(x_sliced))
-    if (!inherits(type, "ListType")) {
+    if (!inherits(type, "ListType") && !inherits(type, "LargeListType")) {

Review comment:
       ```suggestion
       if (!inherits(type, c("ListType", "LargeListType"))) {
   ```

##########
File path: r/tests/testthat/test-Array.R
##########
@@ -18,16 +18,16 @@
 context("Array")
 
 expect_array_roundtrip <- function(x, type) {
-  a <- Array$create(x)
+  a <- Array$create(x, type = type)
   expect_type_equal(a$type, type)
   expect_identical(length(a), length(x))
-  if (!inherits(type, "ListType")) {
+  if (!inherits(type, "ListType") && !inherits(type, "LargeListType")) {

Review comment:
       Can/should LargeListType inherit from ListType?
   
   ```suggestion
     if (!inherits(type, c("ListType", "LargeListType"))) {
   ```




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to