Repository navigation
Use ISO calendar constructors for week dates - #1401
Open
DU8866-nice wants to merge 4 commits into
Open
DU8866-nice wants to merge 4 commits into
DU8866-nice wants to merge 4 commits into
Conversation
Parse valid early ISO years without an intermediate strptime conversion. Prepared and verified with OpenAI Codex.
Use date.fromisocalendar while retaining the existing week/day range errors. Prepared and verified with OpenAI Codex.
Regression tests verified to fail on the original implementation. Prepared with OpenAI Codex.
Add explicit expected dates for years 0001, 0099 and 0999, and invalid week-53 strings. Prepared and verified with OpenAI Codex.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1401 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 10 10
Lines 2315 2310 -5
Branches 358 358
=========================================
- Hits 2315 2310 -5 ☔ 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.
Description of Changes
ISO week-date conversion has two edge cases:
Use
date.fromisocalendar()for tuple conversion anddatetime.fromisocalendar()in the parser. The tuple path now rejects nonexistent week 53 instead of rolling into the next ISO year. The parser no longer formats an early year without leading zeros before callingstrptime. Both constructors are available in Arrow's supported Python range (3.8+); existing utility range-check messages are retained.Regression tests cover invalid week-53 tuples, early-year parsing and invalid week-53 strings. Existing tests cover valid week 53 and year crossings.
Validation
git diff --checkpasses.Initial remote CI run
Lint and 21 matrix test jobs passed. Three jobs failed before running tests:
Connection broken: IncompleteRead(log).These are environment/setup failures. The Windows PyPy job needs a retry; the two older CPython Linux jobs need a compatible runner image.
Pull Request Checklist
AI assistance
Prepared with OpenAI Codex (GPT-6), including source inspection, regression tests, the fix and an independent agent review. The reported results were verified by running the commands; no human code review is claimed.