rok commented on code in PR #13440:
URL: https://github.com/apache/arrow/pull/13440#discussion_r923872217
##########
r/R/dplyr-funcs-datetime.R:
##########
@@ -209,6 +209,13 @@ register_bindings_datetime_components <- function() {
build_expr("month", x)
})
+ register_binding("lubridate::qday", function(x) {
+ # We calculate day of quarter by flooring timestamp to beginning of
quarter and
+ # calculating days between beginning of quarter and timestamp/date in
question.
+ floored_x <- build_expr("floor_temporal", x, options = list(unit = 9L))
+ build_expr("days_between", floored_x, x) + Expression$scalar(1L)
Review Comment:
```suggestion
# We calculate day of quarter by flooring timestamp to beginning of
quarter and
# calculating days between beginning of quarter and timestamp/date in
question.
# Since we use one one-based numbering we add one.
floored_x <- build_expr("floor_temporal", x, options = list(unit = 9L))
build_expr("days_between", floored_x, x) + Expression$scalar(1L)
```
--
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]