AlenkaF commented on code in PR #55811:
URL: https://github.com/apache/arrow/pull/55811#discussion_r4769535752
##########
python/pyarrow/array.pxi:
##########
@@ -2717,6 +2717,68 @@ cdef class DurationArray(NumericArray):
"""
+cdef class MonthIntervalArray(Array):
+ """
+ Concrete class for Arrow arrays of interval[month] data type.
+ """
+
+ def to_pylist(self, *, maps_as_pydicts=None):
+ """
+ Convert to a list of native Python objects.
+
+ pyarrow.Month is used as the native representation.
+
+ Parameters
+ ----------
+ maps_as_pydicts : str, optional, default `None`
+ Valid values are `None`, 'lossy', or 'strict'.
+ This parameter is ignored for non-nested Scalars.
+
+ Returns
+ -------
+ lst : list
+ """
+ cdef:
+ CResult[PyObject*] maybe_py_list
+ PyObject* py_list
+ CMonthIntervalArray* array
+ array = <CMonthIntervalArray*>self.sp_array.get()
Review Comment:
7964475ab841c960197f3f44c692961f6ed72e24
##########
python/pyarrow/array.pxi:
##########
@@ -2717,6 +2717,68 @@ cdef class DurationArray(NumericArray):
"""
+cdef class MonthIntervalArray(Array):
+ """
+ Concrete class for Arrow arrays of interval[month] data type.
+ """
+
+ def to_pylist(self, *, maps_as_pydicts=None):
+ """
+ Convert to a list of native Python objects.
+
+ pyarrow.Month is used as the native representation.
+
+ Parameters
+ ----------
+ maps_as_pydicts : str, optional, default `None`
+ Valid values are `None`, 'lossy', or 'strict'.
+ This parameter is ignored for non-nested Scalars.
+
+ Returns
+ -------
+ lst : list
+ """
+ cdef:
+ CResult[PyObject*] maybe_py_list
+ PyObject* py_list
+ CMonthIntervalArray* array
+ array = <CMonthIntervalArray*>self.sp_array.get()
+ maybe_py_list = MonthIntervalArrayToPyList(deref(array))
+ py_list = GetResultValue(maybe_py_list)
+ return PyObject_to_object(py_list)
+
+
+cdef class DayTimeIntervalArray(Array):
+ """
+ Concrete class for Arrow arrays of interval[day_time] data type.
+ """
+
+ def to_pylist(self, *, maps_as_pydicts=None):
+ """
+ Convert to a list of native Python objects.
+
+ pyarrow.DayTime is used as the native representation.
+
+ Parameters
+ ----------
+ maps_as_pydicts : str, optional, default `None`
+ Valid values are `None`, 'lossy', or 'strict'.
+ This parameter is ignored for non-nested Scalars.
+
+ Returns
+ -------
+ lst : list
+ """
+ cdef:
+ CResult[PyObject*] maybe_py_list
+ PyObject* py_list
+ CDayTimeIntervalArray* array
+ array = <CDayTimeIntervalArray*>self.sp_array.get()
Review Comment:
7964475ab841c960197f3f44c692961f6ed72e24
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]