This is an automated email from the ASF dual-hosted git repository.
tustvold pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git
The following commit(s) were added to refs/heads/master by this push:
new eeba0a3792 Relax constraints on PyArrowType (#4757)
eeba0a3792 is described below
commit eeba0a3792a2774dee1d10a25340b2741cf95c9e
Author: Raphael Taylor-Davies <[email protected]>
AuthorDate: Thu Aug 31 17:19:33 2023 +0100
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 54a247d53e..0e9669c5e9 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<T: FromPyArrow + IntoPyArrow>(pub T);
+pub struct PyArrowType<T>(pub T);
-impl<'source, T: FromPyArrow + IntoPyArrow> FromPyObject<'source> for
PyArrowType<T> {
+impl<'source, T: FromPyArrow> FromPyObject<'source> for PyArrowType<T> {
fn extract(value: &'source PyAny) -> PyResult<Self> {
Ok(Self(T::from_pyarrow(value)?))
}
}
-impl<T: FromPyArrow + IntoPyArrow> IntoPy<PyObject> for PyArrowType<T> {
+impl<T: IntoPyArrow> IntoPy<PyObject> for PyArrowType<T> {
fn into_py(self, py: Python) -> PyObject {
match self.0.into_pyarrow(py) {
Ok(obj) => obj,
@@ -312,7 +312,7 @@ impl<T: FromPyArrow + IntoPyArrow> IntoPy<PyObject> for
PyArrowType<T> {
}
}
-impl<T: FromPyArrow + IntoPyArrow> From<T> for PyArrowType<T> {
+impl<T> From<T> for PyArrowType<T> {
fn from(s: T) -> Self {
Self(s)
}