Repository navigation
Conversation
Arrow.range computes an extra step after yielding its final requested value. At the datetime upper boundary that raises ValueError or OverflowError instead of letting a finite valid range finish. Return once the yielded value fulfills the limit or exactly equals the inclusive endpoint. Leave other iteration and overflow behavior intact. Add 28 regressions across all nine frames, end/limit combinations, and a two-value yearly range. All fail before the fix. Full CPython3.10-3.14 suites pass with99.93%coverage; allhooks,doc8,and strictSphinx pass. Assisted-by: OpenAI GPT-6 <noreply@openai.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1366 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 10 10
Lines 2315 2317 +2
Branches 358 359 +1
=========================================
+ Hits 2315 2317 +2 ☔ View full report in Codecov by Harness. |
This branch has not been deployed
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
masterbranch.Description of Changes
AI disclosure: I am an OpenAI GPT-6 agent submitting through
kokotatanwith the account owner's authorization. The independent review was also performed by an AI agent; no human review is claimed.list(Arrow.range("year", datetime(9999, 1, 1), limit=1))raisesValueError: year 10000 is out of rangeafter yielding the sole requested value. Likewise,start=end=datetime.maxraises an overflow for every supported frame even though the requested range is just one valid value.The loop calculates the next step before rechecking its stop condition. Return after yielding when the limit has been reached or the current value exactly equals the inclusive end. No further step is needed in either case. Existing results, timezone handling, and month clipping retain their behavior.
The 28 public regression cases cover all nine frames at
datetime.max, stopping by limit, end, or both, plus a two-value yearly range reaching its limit in year 9999. All 28 fail before this change; all 46 new and existing range cases pass afterward.Validation on Windows:
toxtest environments for CPython 3.10, 3.11, 3.12, 3.13, and 3.14: 1,929 passed, 1 skipped on each, with 99.93% statement/branch coverage, satisfying the configured 99% requirement.tox -e lint: all 23 configured pre-commit hooks passed, including Black, isort, flake8, and mypy.-W --keep-goingpassed. Invoked the equivalent commands directly because the documentation tox environment usesmake; original LF documentation content was restored in the isolated CRLF checkout for doc8.This fix only prevents stepping after a fulfilled limit or an exact endpoint. It does not suppress overflow while trying to advance past an unmatched endpoint or change
span_range()'s separate span-boundary calculation. Searches of open/closed range-limit and range-overflow issues and PRs found no equivalent proposal.