paleolimbot commented on issue #331:
URL: 
https://github.com/apache/arrow-nanoarrow/issues/331#issuecomment-1839578943

   I *think* that is a good idea, although I might need a more specific example 
to more concretely comment. Today you might have to use `as_nanoarrow_array()` 
as a backup. It may not be quite the same, but in the `geos` and `s2` and 
`geoarrow` packages I fall back on `wk_handle()`'s generic (which avoids most 
of those packages having to know about any of the others). I'd like to move 
those to start using `as_nanoarrow_array_stream()` in a way like you described.
   
   In general, the pattern I envisioned for interchange is:
   
   - Producers that produce objects that can be interpreted as arrays implement 
an `as_nanoarrow_array()` S3 method (e.g., `arrow::Array` has a method for 
`as_nanoarrow_array()`)
   - Consumers that accept arrays call `as_nanoarrow_array()` to sanitize the 
input.
   
   The `as_nanoarrow_array_stream()` version is slightly more generic (e.g., 
can accommodate streaming results and/or Chunked arrays), but isn't *quite* 
where it should be (e.g., if you call `as_nanoarrow_array_stream()` on an 
`arrow::ChunkedArray` today, I think you would get an error, even though it 
*should* work).


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