You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/06/28 08:28:47 UTC

[GitHub] [arrow] thisisnic commented on a diff in pull request #13440: ARROW-14819: [R] Binding for lubridate::qday

thisisnic commented on code in PR #13440:
URL: https://github.com/apache/arrow/pull/13440#discussion_r908192224


##########
r/R/dplyr-funcs-datetime.R:
##########
@@ -172,6 +172,15 @@ register_bindings_datetime_components <- function() {
     (call_binding("yday", x) - 1) %/% 7 + 1
   })
 
+  register_binding("qday", function(x) {
+    floored_x <- Expression$create("floor_temporal", x, options = list(unit = 9L, calendar_based_origin = FALSE))
+    days_between <- Expression$create("days_between", floored_x, x)
+    if (call_binding("is.Date", x)) {
+        return(Expression$create("add", days_between, Expression$scalar(1L)))
+    }
+    days_between

Review Comment:
   Please can you add a brief comment on why the difference here?



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org