pyo3_arrow/ffi/from_python/schema.rs
1use crate::ffi::from_python::utils::call_arrow_c_schema;
2use crate::schema::PySchema;
3use pyo3::prelude::*;
4use pyo3::{PyAny, PyResult};
5
6impl<'a> FromPyObject<'a> for PySchema {
7 fn extract_bound(ob: &Bound<'a, PyAny>) -> PyResult<Self> {
8 let schema_ptr = call_arrow_c_schema(ob)?;
9 Self::from_arrow_pycapsule(&schema_ptr)
10 }
11}