alamb commented on code in PR #9594:
URL: https://github.com/apache/arrow-rs/pull/9594#discussion_r3003463633
##########
arrow-pyarrow/src/lib.rs:
##########
@@ -156,36 +155,27 @@ impl FromPyArrow for DataType {
// method, so prefer it over _export_to_c.
// See
https://arrow.apache.org/docs/format/CDataInterface/PyCapsuleInterface.html
if value.hasattr("__arrow_c_schema__")? {
- let capsule = value.getattr("__arrow_c_schema__")?.call0()?;
- let capsule = capsule.cast::<PyCapsule>()?;
- validate_pycapsule(capsule, "arrow_schema")?;
+ let capsule = value.call_method0("__arrow_c_schema__")?.extract()?;
Review Comment:
looks like the corret usecase:
https://docs.rs/pyo3/latest/pyo3/prelude/trait.PyAnyMethods.html#tymethod.call_method0
--
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]