Add an "all" granularity to humanize#1018
Open
MarkKoz wants to merge 9 commits intoarrow-py:masterfrom
Open
Conversation
It's more convenient to pass a simple short string than to pass a list of 7 strings. Resolve arrow-py#1014
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1018 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 10 10
Lines 2326 2239 -87
Branches 400 440 +40
=========================================
- Hits 2326 2239 -87
☔ View full report in Codecov by Sentry. |
systemcatch
reviewed
Aug 29, 2021
The assertions only worked for certain dates and times. For example, a difference of 2 months could result in "1 month and 29 days" rather than "2 months" depending on the start time. Since utcnow() was used, assertions could fail if ran at a later date. Fix this by using a fixed time for test data rather than utcnow().
Since arrow-py#996 was fixed by arrow-py#1077, the test no longer needs to use the incorrect data to work around the bug.
Author
|
The lint check failure seems to be a problem with CI rather than with my changes. |
Collaborator
|
Hmmm lint passes now, looks like it was some kind of |
Member
|
Hi @MarkKoz mind resolving the conflicts in this PR? |
5b336f2 to
71d5233
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pull Request Checklist
Thank you for taking the time to improve Arrow! Before submitting your pull request, please check all appropriate boxes:
toxormake testto find out!).tox -e lintormake lintto find out!).masterbranch.If you have any questions about your code changes or any of the points above, please submit your questions along with the pull request and we will try our best to help!
Description of Changes
Add an "all" granularity to the humanize function. When specified, it internally sets all possible units for the granularity (years, months, weeks, days, hours, minutes, and seconds). This granularity is mutually exclusive with the other granularities; it's not valid to specify it in a list of granularities.
The motivation is that it's more convenient to specify a single string than a list of 7 strings. It will make more sense to use full precision once #997 is merged. Speaking of which, some newly added tests will have to be fixed once #997 is merged and the
describe_multibug is fixed.Resolve #1014