fix: a day that does not exist costs one field, not one house - #145
Merged
Conversation
`2025-02-30T00:00:00Z` passes the shape test and the range test, then `strptime` raises a bare ValueError. `_record()` catches UnreadableDate alone, so the error reached the house handler, wrote one fetch_error, and abandoned every later bill in that house. Codex filed this as a P1 on #142 and it merged unfixed: the review carried two comments and only one was read.
Merged
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.
A P1 that Codex filed on #142 and that merged unfixed. The review carried two comments. I read one, answered it, and pushed. The other one is this.
The defect.
2025-02-30T00:00:00Zpasses the shape test and the range test, thenstrptimeraises a bareValueError._record()catchesUnreadableDatealone, so the error reaches the house-level handler inprobe(), writes onefetch_error, and abandons every later bill in that house.That is exactly the failure 0.15.0 fixed for other date shapes. One bad field must cost one field.
The fix. The rung raises
UnreadableDatewith the day named. The field goes to null,fetch_statusbecomesparse_error, and the bill keeps its name, ministry, status and file URLs.Tests, both reproduced first:
test_an_impossible_day_raises_unreadable_not_value_errortest_the_house_survives_an_impossible_day— a bad bill first, a good bill second, and the good one must still arrive.Neighbours checked, since this is the class where my own fixes have bitten before:
2025-02-29 00:00:00.0and31/02/2025already raised correctly through the_DATE_FORMATSloop, and2024-02-29T00:00:00Zstill reads, because 2024 is a leap year.1805 passed, 2 skipped, ruff clean.
This ships in 0.15.1.