From 51572f09c5ff74b3c119cca2841c04c862c89ecd Mon Sep 17 00:00:00 2001 From: Raphael Taylor-Davies Date: Thu, 31 Aug 2023 12:45:59 +0100 Subject: [PATCH] Relax constraints on PyArrowType --- arrow/src/pyarrow.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arrow/src/pyarrow.rs b/arrow/src/pyarrow.rs index 54a247d53e6d..0e9669c5e9fa 100644 --- a/arrow/src/pyarrow.rs +++ b/arrow/src/pyarrow.rs @@ -295,15 +295,15 @@ impl IntoPyArrow for ArrowArrayStreamReader { /// A newtype wrapper around a `T: PyArrowConvert` that implements /// [`FromPyObject`] and [`IntoPy`] allowing usage with pyo3 macros #[derive(Debug)] -pub struct PyArrowType(pub T); +pub struct PyArrowType(pub T); -impl<'source, T: FromPyArrow + IntoPyArrow> FromPyObject<'source> for PyArrowType { +impl<'source, T: FromPyArrow> FromPyObject<'source> for PyArrowType { fn extract(value: &'source PyAny) -> PyResult { Ok(Self(T::from_pyarrow(value)?)) } } -impl IntoPy for PyArrowType { +impl IntoPy for PyArrowType { fn into_py(self, py: Python) -> PyObject { match self.0.into_pyarrow(py) { Ok(obj) => obj, @@ -312,7 +312,7 @@ impl IntoPy for PyArrowType { } } -impl From for PyArrowType { +impl From for PyArrowType { fn from(s: T) -> Self { Self(s) }