arrow-py / arrow

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

Partial Humanize Refactor #971

Closed anishnya closed 3 years ago

anishnya 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

I've completed a partial refactor of Humanize as per #749. This doesn't fix the issues we are having with leap years, or other correctness related issues (that will hopefully come at a later date). This PR cleans up some of the more nasty if statements we had in there, making humanize much shorter, and in my opinion much more readable.

codecov[bot] commented 3 years ago

Codecov Report

Merging #971 (cfee46d) into master (06fe693) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #971   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           10        10           
  Lines         2036      2009   -27     
  Branches       328       316   -12     
=========================================
- Hits          2036      2009   -27     
Impacted Files Coverage Δ
arrow/arrow.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 06fe693...cfee46d. Read the comment docs.