atwam commented on code in PR #5355:
URL: https://github.com/apache/arrow-rs/pull/5355#discussion_r1473136727
##########
arrow/src/pyarrow.rs:
##########
@@ -355,7 +355,12 @@ impl FromPyArrow for RecordBatch {
));
}
let array = StructArray::from(array_data);
- return Ok(array.into());
+ // StructArray does not embed metadata from schema. We need to
override
+ // the output schema with the schema from the capsule.
+ let schema =
Arc::new(Schema::try_from(schema_ptr).map_err(to_py_err)?);
+ return RecordBatch::from(array)
+ .with_schema(schema)
+ .map_err(to_py_err);
Review Comment:
Excellent point, I should have looked at the conversion code from
`StructArray`. Fixed.
--
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]