emkornfield commented on a change in pull request #11302:
URL: https://github.com/apache/arrow/pull/11302#discussion_r721878423
##########
File path: python/pyarrow/scalar.pxi
##########
@@ -514,6 +514,32 @@ cdef class DurationScalar(Scalar):
return datetime.timedelta(microseconds=sp.value // 1000)
+cdef class MonthDayNanoIntervalScalar(Scalar):
+ """
+ Concrete class for month, day, nanosecond scalars.
+ """
+
+ @property
+ def value(self):
+ """
+ Returns this value pyarrow.MonthDayNanoTuple.
+ """
+ cdef PyObject* val
+ val = GetResultValue(ARROW_TO_PYTHON.ToPrimitive(
+ (deref(self.wrapped.get()))))
+ return PyObject_to_object(val)
+
+ def as_py(self):
+ """
+ Return this value as a Pandas DateOffset instance if Pandas is present
+ otherwise as a named tuple containing months days and nanoseconds.
Review comment:
Going to change. This actually simplifies the code a lot.
--
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]