-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-14808 [R] Implement bindings for lubridate::date()
#12433
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 good — a few questions for you
57ce8c9 to
2d72983
Compare
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.
One comment + suggestion.
Do we have a ticket to do as.Date separately? Could we do it with this one since it is very very similar?
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.
A few comments
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 making progress! I didn't quite realize that as.Date() would be as much of a can of worms as it's been — but that's ok, I think it is useful additional functionality!
In the as.Date() implementation it might be nice to restructure the flow so that you have one call at the end to build_expr("cast", intermediate, options = cast_options(to_type = date32())) after having built up intermediate getting things into the right format and then do the cast-to-date (I put intermediate here but that's probably not a good name for it, maybe "just" x like we do elsewhere — I trust you!).
|
I have created an umbrella issue (ARROW-15805) for the possible improvements to the |
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, a few more questions. I didn't realize just how much extra scope as.Date() would add — though I think this is good functionality to add, so that's ok, but don't feel dispirited this is taking longer!
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.
Still getting there, most of the code changes I proposed are attempts to avoid some of the nesting in if/elses. Though I also do think we can support as.Date() with any timezone which will simplify + remove some of the tests down below catching that error.
|
Thanks @jonkeane. Would you mind having another look? |
…character, but not an `Expression`
…k for `origin` at the top of the numeric block
…n + simplified some unit tests
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 fantastic, thank you for all of the pushes. This is incredibly close — one minor comment about an additional comment and one suggestion to use compare_dplyr_binding for testing the warning flow "not supported in arrow -> pulling into R". It's functionally the same, but follows the pattern we use elsewhere.
I'm happy to merge even without these, but these two would add a bit of polish + fit
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.
Once the CI is green, I'll merge.
Thank you again for all of the work you did on this!
|
Thanks for your patience and support 😉 |
|
Benchmark runs are scheduled for baseline = ce46c1a and contender = 9719eae. 9719eae is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
`build_expr()` handles the conversion of the inputs to `Array` or `Scalar`. #12433 (comment) Closes #12563 from dragosmg/build_expr_in_as_methods Authored-by: Dragoș Moldovan-Grünfeld <dragos.mold@gmail.com> Signed-off-by: Jonathan Keane <jkeane@gmail.com>
The following will be supported in arrow (
base::as.Date()included to show the difference todate(), but not supported):Created on 2022-02-15 by the reprex package (v2.0.1)