-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-14821: [C++] Add ceil_is_strictly_greater and calendar_based_origin temporal round options (to mimic lubridate's date rounding) #12657
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
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
7f4ec7b
Add change_on_boundary to RoundTemporalOptions
rok c4ab6e2
Apply suggestions from code review
rok 88c8646
Review feedback.
rok 29fdbf2
Review feedback.
rok c240ebb
Review feedback
rok 4d816b7
strict_ceil to ceil_on_boundary
rok 4160a40
Apply suggestions from code review
rok 177b233
Apply suggestions from code review
rok 9fe7a06
Apply suggestions from code review
rok e9f36fb
ceil_on_boundary -> ceil_is_strictly_greater
rok af2a5e3
Review feedback.
rok c5c7cc0
Update python/pyarrow/_compute.pyx
rok b2ff7a2
Update python/pyarrow/_compute.pyx
rok 65807b7
review feedback
rok 167236d
multiple_since_greater_unit->calendar_based_origin
rok b2f9226
Update python/pyarrow/_compute.pyx
rok 38696a6
review feedback
rok 422b022
Comments for RoundTemporalOptions.calendar_based_origin
rok de82528
Apply suggestions from code review
rok File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
To be honest, (before looking at the implementation) this explanation is not really clear to me what the effect exactly is.
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.
By looking at the code and the inline comments, it became clear. One of the comments is
I wanted to suggest using that. Although reading the above again, that's actually already quite similar. But the additional example might help to clarify.
One question I have is how it is exactly defined what the "one less precise calendar unit" / "last greater unit" is? Eg we have "week" between "day" and "month", but we are still using "month" as the greater unit for "day"? (which probably makes sense in practice, but we should maybe document this somewhere more explicitly)
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.
Makes sense. I'll move the comments around.
Regarding the unit ordering I'm basically implementing for lubridate parity (and dropping
bimonth, season, halfyearunits). I suppose we can either document behaviour or let user choose the "origin unit". I would prefer to just document for now.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.
How about
round_from_greater_unit?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 only relevant if
multipleis not 1, right? Because in that case it could also be something likemultiple_since_greater_unitThere 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.
Yeah, only for
multiple != 1.multiple_since_greater_unitsounds good.Uh oh!
There was an error while loading. Please reload this page.
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.
Changed to
multiple_since_greater_unit.