paleolimbot commented on issue #35531:
URL: https://github.com/apache/arrow/issues/35531#issuecomment-1724872797

   Thank you for writing this up! You nailed what I had in mind with respect to 
schema negotiation. What you have here strikes (in my opinion) the perfect 
balance of easy-to-use (because any complexity of usage only comes up if the 
caller chooses to use the `requested_schema`) and easy-to-implement (because 
the producer is free to ignore the schema argument).
   
   FWIW, the order I usually see is `array` then `schema` (e.g., for return 
type of the `__arrow_c_array__`) (e.g., the same order you currently pass 
`_export_to_c(array_addr, schema_addr)`).
   
   I don't know if it's worth noting that you can differentiate between a 
"schema-like object" and an "array-like object" by checking if it implements 
`__arrow_c_array__`? If you have a function that wants to accept a "schema" in 
the most generic way possible (e.g., there's a function in `geoarrow-c` that 
initializes a compute kernel based on the input argument data types), you 
probably want to error if somebody tries to pass an `Array`. In R/nanoarrow I 
use two generics to deal with this (`infer_nanoarrow_schema()` and 
`as_nanoarrow_schema()`), but I don't think you need to/should do that here.


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