arrow-py / arrow

🏹 Better dates & times for Python
https://arrow.readthedocs.io
Apache License 2.0
8.7k stars 673 forks source link

Add an "all" granularity to humanize #1018

Open MarkKoz opened 3 years ago

MarkKoz commented 3 years ago

Pull Request Checklist

Thank you for taking the time to improve Arrow! Before submitting your pull request, please check all appropriate boxes:

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_multi bug is fixed.

Resolve #1014

codecov[bot] commented 3 years ago

Codecov Report

All modified lines are covered by tests :white_check_mark:

Comparison is base (87a1a77) 100.00% compared to head (5b336f2) 100.00%.

:exclamation: Current head 5b336f2 differs from pull request most recent head 71d5233. Consider uploading reports for the commit 71d5233 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1018 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 10 10 Lines 2326 2239 -87 Branches 400 440 +40 ========================================= - Hits 2326 2239 -87 ``` | [Files](https://app.codecov.io/gh/arrow-py/arrow/pull/1018?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=arrow-py) | Coverage Δ | | |---|---|---| | [arrow/arrow.py](https://app.codecov.io/gh/arrow-py/arrow/pull/1018?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=arrow-py#diff-YXJyb3cvYXJyb3cucHk=) | `100.00% <100.00%> (ø)` | | ... and [4 files with indirect coverage changes](https://app.codecov.io/gh/arrow-py/arrow/pull/1018/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=arrow-py)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

MarkKoz commented 2 years ago

The lint check failure seems to be a problem with CI rather than with my changes.

systemcatch commented 2 years ago

Hmmm lint passes now, looks like it was some kind of setuptools install error that was causing issues.

jadchaar commented 1 year ago

Hi @MarkKoz mind resolving the conflicts in this PR?