-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-16253: [R] Helper function for casting from float to duration via int64() #13055
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
jonkeane
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking through, I think I found a few other places this might be helpful. What about the followin?
arrow/r/R/dplyr-funcs-datetime.R
Lines 415 to 417 in 3a646b3
| # complex casting only due to cast type restrictions: time64 -> int64 -> duration(us) | |
| # and then we cast to duration ("s") at the end | |
| x <- x$cast(time64("us"))$cast(int64())$cast(duration("us")) |
arrow/r/R/dplyr-funcs-datetime.R
Lines 354 to 355 in 3a646b3
| delta <- delta$cast(int64()) | |
| start + delta$cast(duration("s")) |
We also mention that issue at
arrow/r/R/dplyr-datetime-helpers.R
Line 146 in 3a646b3
| # https://issues.apache.org/jira/browse/ARROW-16253 (helper function for |
|
Thanks @jon. I should've probably offered some details on why I didn't use arrow/r/R/dplyr-funcs-datetime.R Lines 415 to 417 in 3a646b3
I had added a comment in b4ccc08, on why for arrow/r/R/dplyr-funcs-datetime.R Lines 354 to 355 in 3a646b3
Done! That was an oversight for arrow/r/R/dplyr-datetime-helpers.R Line 146 in 3a646b3
we can't really use |
…n inside `binding_as_date_numeric()` + removed commented referencing ARROW-16253
|
I think this is ready for another look. |
jonkeane
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good to go (with a slight clean up of a comment).
I've not looked extensively to see if there are other places we could use this like the handful I noted, have you taken a look through the date-time codebase to see if there are more?
|
I haven't found more places in which to use this. |
|
Benchmark runs are scheduled for baseline = 824f58f and contender = 101f63e. 101f63e is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
No description provided.