-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-14941 [R] Implement Duration R6 class and bindings for lubridate::duration() #11850
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
Co-authored-by: Romain François <romain@rstudio.com>
|
Ok! This now works: library(arrow, warn.conflicts = FALSE)
(arr <- Array$create(as.difftime(123, units = "secs")))
#> Array
#> <time32[s]>
#> [
#> 00:02:03
#> ]
as.vector(arr)
#> Time difference of 123 secsCreated on 2021-12-10 by the reprex package (v2.0.1) I haven't implemented the |
|
Just updating my reprex to show that it does, in fact work! (forgot to reinstall arrow from this branch before running reprex): # remotes::insatll_github("paleolimbot/arrow/r@r-duration-type")
library(arrow, warn.conflicts = FALSE)
(arr <- Array$create(as.difftime(123, units = "secs")))
#> Array
#> <duration[s]>
#> [
#> 123
#> ]
as.vector(arr)
#> Time difference of 123 secs |
|
Thanks for this! Looks like there's one more entry in arrow.Rmd that needs to be edited, showing the mapping of Arrow Duration type to R, the table below the one that was. |
|
Thanks for catching that. I've made https://issues.apache.org/jira/browse/ARROW-15082 |
|
Benchmark runs are scheduled for baseline = ab46725 and contender = cf8d81d. cf8d81d is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
All good, though would you mind opening a new ticket for that? |
|
Done! See ARROW-15098. |
This PR is an attempt to fix the [sanitizer failure](https://dev.azure.com/ursacomputing/crossbow/_build/results?buildId=17171&view=logs&j=0da5d1d9-276d-5173-c4c4-9d4d4ed14fdb&t=d9b15392-e4ce-5e4c-0c8c-b69645229181&l=12824) caused by ARROW-14941 (#11850). @jonkeane could you remind me how to submit a job to the sanitizer checker? Closes #11947 from paleolimbot/r-fix-duration Authored-by: Dewey Dunnington <dewey@fishandwhistle.net> Signed-off-by: Antoine Pitrou <antoine@python.org>
The PR updates the 'Get Started' vignette that should have been updated to reflect the mapping of the duration type to R's difftime in #11850 / ARROW-14941 but wasn't. Closes #11948 from paleolimbot/r-duration-in-vignette Authored-by: Dewey Dunnington <dewey@fishandwhistle.net> Signed-off-by: Jonathan Keane <jkeane@gmail.com>
This PR implements the Duration type in the R bindings, mapped to "difftime", which is the equivalent base R type. Currently a draft PR because I'm unsure how to implement the
Extend()method of the converter:arrow/r/src/r_to_arrow.cpp
Lines 824 to 826 in 7240420
I've also copy-and-pasted the converter for the TIME32/hms object conversion because I was unsure how to subclass it to avoid the repetition in the moment.
The gist of the PR is to allow this (which currently fails):
Created on 2021-12-03 by the reprex package (v2.0.1)