pyo3_arrow/ffi/from_python/record_batch.rs
1use crate::ffi::from_python::utils::call_arrow_c_array;
2use crate::record_batch::PyRecordBatch;
3use pyo3::prelude::*;
4use pyo3::PyAny;
5
6impl<'py> FromPyObject<'_, 'py> for PyRecordBatch {
7 type Error = PyErr;
8
9 fn extract(obj: Borrowed<'_, 'py, PyAny>) -> Result<Self, Self::Error> {
10 let (schema_capsule, array_capsule) = call_arrow_c_array(&obj)?;
11 Self::from_arrow_pycapsule(&schema_capsule, &array_capsule)
12 }
13}