From eeba0a3792a2774dee1d10a25340b2741cf95c9e Mon Sep 17 00:00:00 2001 From: Raphael Taylor-Davies <1781103+tustvold@users.noreply.github.com> Date: Thu, 31 Aug 2023 17:19:33 +0100 Subject: [PATCH] Relax constraints on PyArrowType (#4757) --- 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) }