kylebarron commented on code in PR #5070:
URL: https://github.com/apache/arrow-rs/pull/5070#discussion_r1394459884


##########
arrow/src/pyarrow.rs:
##########
@@ -247,6 +329,40 @@ impl<T: ToPyArrow> ToPyArrow for Vec<T> {
 
 impl FromPyArrow for RecordBatch {
     fn from_pyarrow(value: &PyAny) -> PyResult<Self> {
+        // Newer versions of PyArrow as well as other libraries with Arrow 
data implement this
+        // method, so prefer it over _export_to_c.
+        // See 
https://arrow.apache.org/docs/format/CDataInterface/PyCapsuleInterface.html
+        if value.hasattr("__arrow_c_array__")? {

Review Comment:
   Yeah... I'm not sure if there's a standard way in Arrow to discern between a 
StructArray intended to be an array, vs a StructArray intended to represent a 
RecordBatch



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