Repository navigation
Conversation
…d end-of-month anchoring Resolves arrow-py#948.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1367 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 10 10
Lines 2315 2346 +31
Branches 358 366 +8
=========================================
+ Hits 2315 2346 +31 ☔ View full report in Codecov by Harness. |
|
The remaining failure at In Windows PyPy 3.11 job 112060119718, tox exits during The earlier pip upgrade also reports an This failure does not call for a change to the PR's code or dependencies. Please rerun the failed Windows PyPy job to retry the interrupted downloads; the required check remains red until a successful rerun. |
Pull Request Checklist
pytestwith the existing coverage gate).tox -e lintormake lint).masterbranch.Description of Changes
Closes #948.
Multi-granularity
humanizeused a fixed 30.5-day month, which could discard calendar days. For example, 2017-01-01 to 2018-05-03 06:00:02 produced zero remaining days instead of two.Decompose calendar years, quarters, and months from the original date anchor, then decompose the remaining rounded elapsed seconds into fixed units. Align the endpoint timezone only for calendar calculation, preserve the original aware endpoint for elapsed seconds, and preserve the original datetime when zero months are consumed so its DST fold survives. Fixed-only lists skip calendar conversion. Default and single-granularity paths retain their existing behavior.
When timezone projection exceeds datetime's year range, retain the aware endpoints, consume representable original month anchors, and decompose the remaining elapsed seconds; this does not require constructing a year-10000 month anchor.
Nine new regression tests cover the reported example, both directions, omitted units, leap days and month-end anchoring, subsecond rounding, DST transitions and fold, cross-timezone month boundaries, and datetime-range overflow.
Validation
Final commit:
e14dcc31e59b090a9907ecc9cef40a5b8f971c7c.IncompleteReaderror. The contributor account cannot rerun this upstream workflow; a maintainer rerun is needed.