pyo3_arrow/ffi/from_python/
table.rs

1use crate::ffi::from_python::utils::call_arrow_c_stream;
2use crate::table::PyTable;
3use pyo3::prelude::*;
4use pyo3::PyAny;
5
6impl<'a> FromPyObject<'_, 'a> for PyTable {
7    type Error = PyErr;
8
9    fn extract(obj: Borrowed<'_, 'a, PyAny>) -> Result<Self, Self::Error> {
10        let capsule = call_arrow_c_stream(&obj)?;
11        Self::from_arrow_pycapsule(&capsule)
12    }
13}