rok commented on a change in pull request #11818:
URL: https://github.com/apache/arrow/pull/11818#discussion_r773408167
##########
File path: python/pyarrow/_compute.pyx
##########
@@ -774,6 +774,48 @@ class RoundOptions(_RoundOptions):
self._set_options(ndigits, round_mode)
+cdef CCalendarUnit unwrap_round_unit(unit) except *:
+ if unit == "nanosecond":
+ return CCalendarUnit_NANOSECOND
+ elif unit == "microsecond":
+ return CCalendarUnit_MICROSECOND
+ elif unit == "millisecond":
+ return CCalendarUnit_MILLISECOND
+ elif unit == "second":
+ return CCalendarUnit_SECOND
+ elif unit == "minute":
+ return CCalendarUnit_MINUTE
+ elif unit == "hour":
+ return CCalendarUnit_HOUR
+ elif unit == "day":
+ return CCalendarUnit_DAY
+ elif unit == "week":
+ return CCalendarUnit_WEEK
+ elif unit == "month":
+ return CCalendarUnit_MONTH
+ elif unit == "season":
+ return CCalendarUnit_SEASON
+ elif unit == "year":
+ return CCalendarUnit_YEAR
+ _raise_invalid_function_option(unit, "Calendar unit")
Review comment:
There is pandas shorthand and R shorthand. I'll check if it makes sense
to parse them in c++.
--
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]