djnavarro opened a new pull request #12154:
URL: https://github.com/apache/arrow/pull/12154


   This patch provides dplyr bindings to for lubridate functions 
`floor_date()`, `ceiling_date()`, and `round_date()`. This is my first attempt 
at writing a patch, so my apologies if I've made any errors 🙂 
   
   ### Supported functionality:
   
   - Allows rounding to integer multiples of common time units (second, 
minutes, days, etc)
   - Mirrors the lubridate syntax allowing fractional units such as `unit = 
.001 seconds` as an alias for `unit = 1 millisecond`
   - Allows partial matching of date units based on first three characters: 
e.g. `sec`, `second`, `seconds` all match `second`
   - Mirrors lubridate in throwing errors when unit exceeds thresholds: 60 
seconds, 60 minutes, 24 hours 
   
   ### Major problems not yet addressed:
   
   - Does not yet support the `week_start` argument, and implicitly fixes 
`week_start = 4`
   - Does not yet mirror lubridate handling of timezones 
   
   I'd prefer to fix these two issues before merging, but I'm uncertain how 
best to handle them. Any advice would be appreciated!
    
   ### Minor things not yet addressed
   
   - During rounding lubridate sometimes coerces Date objects to POSIXct. This 
is not mirrored in the arrow bindings: date32 classes remain date32 classes. 
This introduces minor differences in rounding in some cases 
   - Does not yet support the `change_on_boundary` argument to 
`ceiling_date()`. It's a small discrepancy, but it means that the default 
behaviour of the arrow dplyr binding mirrors lubridate prior to v1.6.0
   
   


-- 
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-unsubscr...@arrow.apache.org

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


Reply via email to