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/01/17 05:42:53 UTC

[GitHub] [arrow] djnavarro commented on pull request #12154: ARROW-14821: [R] Implement bindings for lubridate's floor_date, ceiling_date, and round_date

djnavarro commented on pull request #12154:
URL: https://github.com/apache/arrow/pull/12154#issuecomment-1014161114


   I think I've taken this as far as I can right now? I had been hoping to write shims to support the `week_start` and `change_on_boundary` arguments but I'm not sure if that's possible right now. My original thought was to try something like this:
   
   ```r
   week_start_shim <- function(function_name, x, week_start, opts) {
     offset <- Expression$create(Scalar$create(as.difftime(week_start - 4, units = "days")))
     x <- Expression$create("add", x, offset)
     x <- Expression$create(function_name, x, options = opts)
     return(Expression$create("subtract", x, offset)
   } 
   ```
   
   I can't get anything like this to work because (as far as I can tell) we don't currently have the ability to add or subtract durations from date/time in Arrow. I imagine I'm missing something obvious 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