pub trait FromPyArrow: Sized {
const INPUT_TYPE: PyStaticExpr = _;
// Required method
fn from_pyarrow_bound(value: &Bound<'_, PyAny>) -> PyResult<Self>;
}Expand description
Trait for converting Python objects to arrow-rs types.
Provided Associated Constants§
Sourceconst INPUT_TYPE: PyStaticExpr = _
const INPUT_TYPE: PyStaticExpr = _
The Python type this conversion accepts, as a type hint.
Used by [FromPyObject::INPUT_TYPE] on PyArrowType so that a stub generator can write
pyarrow.Array where it would otherwise write _typeshed.Incomplete.
This names pyarrow classes only. Every conversion here also accepts any object
implementing the relevant PyCapsule interface
method, which is duck-typed and has no canonical Python type to point at — neither pyarrow
nor typeshed defines one. The hint is therefore narrower than what is accepted at runtime.
A binding that wants to advertise the wider protocol can declare its own Protocol and
carry it on a newtype around the arrow-rs type.
Required Methods§
Sourcefn from_pyarrow_bound(value: &Bound<'_, PyAny>) -> PyResult<Self>
fn from_pyarrow_bound(value: &Bound<'_, PyAny>) -> PyResult<Self>
Convert a Python object to an arrow-rs type.
Takes a GIL-bound value from Python and returns a result with the arrow-rs type.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl FromPyArrow for ArrayData
impl FromPyArrow for ArrayData
const INPUT_TYPE: PyStaticExpr
fn from_pyarrow_bound(value: &Bound<'_, PyAny>) -> PyResult<Self>
Source§impl FromPyArrow for ArrowArrayStreamReader
Supports conversion from pyarrow.RecordBatchReader to [ArrowArrayStreamReader].
impl FromPyArrow for ArrowArrayStreamReader
Supports conversion from pyarrow.RecordBatchReader to [ArrowArrayStreamReader].
const INPUT_TYPE: PyStaticExpr = ARRAY_STREAM_INPUT_TYPE
fn from_pyarrow_bound(value: &Bound<'_, PyAny>) -> PyResult<Self>
Source§impl FromPyArrow for DataType
impl FromPyArrow for DataType
const INPUT_TYPE: PyStaticExpr
fn from_pyarrow_bound(value: &Bound<'_, PyAny>) -> PyResult<Self>
Source§impl FromPyArrow for Field
impl FromPyArrow for Field
const INPUT_TYPE: PyStaticExpr
fn from_pyarrow_bound(value: &Bound<'_, PyAny>) -> PyResult<Self>
Source§impl FromPyArrow for RecordBatch
impl FromPyArrow for RecordBatch
const INPUT_TYPE: PyStaticExpr
fn from_pyarrow_bound(value: &Bound<'_, PyAny>) -> PyResult<Self>
Source§impl FromPyArrow for Schema
impl FromPyArrow for Schema
const INPUT_TYPE: PyStaticExpr
fn from_pyarrow_bound(value: &Bound<'_, PyAny>) -> PyResult<Self>
Source§impl<T: FromPyArrow> FromPyArrow for Vec<T>
impl<T: FromPyArrow> FromPyArrow for Vec<T>
const INPUT_TYPE: PyStaticExpr
fn from_pyarrow_bound(value: &Bound<'_, PyAny>) -> PyResult<Self>
Implementors§
Source§impl FromPyArrow for Table
Convert a pyarrow.Table (or any other ArrowArrayStream compliant object) into Table
impl FromPyArrow for Table
Convert a pyarrow.Table (or any other ArrowArrayStream compliant object) into Table