paleolimbot commented on code in PR #212:
URL: https://github.com/apache/arrow-nanoarrow/pull/212#discussion_r1221975382


##########
r/R/convert-array-stream.R:
##########
@@ -71,8 +71,6 @@ convert_array_stream <- function(array_stream, to = NULL, 
size = NULL, n = Inf)
   }
 
   if (n_batches == 0L && is.data.frame(to)) {
-    to[integer(0), , drop = FALSE]
-  } else if (n_batches == 0L && is.data.frame(to)) {

Review Comment:
   I wonder if what I meant here was `if (n_batches == 0L && 
!is.data.frame(to))`? I'm pretty sure the first of these two shouldn't return 
`NULL`:
   
   ``` r
   library(nanoarrow)
   stream <- basic_array_stream(batches = list(), schema = na_int32())
   convert_array_stream(stream)
   #> NULL
   
   stream <- basic_array_stream(batches = list(), schema = na_struct(list(x = 
na_int32())))
   convert_array_stream(stream)
   #> [1] x
   #> <0 rows> (or 0-length row.names)
   ```
   
   <sup>Created on 2023-06-07 with [reprex 
v2.0.2](https://reprex.tidyverse.org)</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]

Reply via email to