Repository navigation
Parse a year-only ISO 8601 date in the Rust parser - #1106
Open
dylanpulver wants to merge 1 commit into
Open
dylanpulver wants to merge 1 commit into
dylanpulver wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merging this PR will not alter performance1 note
Comparing |
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.
With the Rust extension (the default),
parse_iso8601("2016")raises "Unexpected end of string while parsing month", while the pure-Python parser returnsdate(2016, 1, 1); its regex already treats the month as optional. The visible symptom ispendulum.parse("2016/2017"), which raisesValueError: month must be in 1..12, not 20with the extension and returnsInterval[2016-01-01 -> 2017-01-01]withPENDULUM_EXTENSIONS=0.I first also accepted a
/after the year, but Python splits intervals before Rust sees the string, so that arm was dead and I dropped it.pytest testsgives 1871 passed with bothPENDULUM_EXTENSIONS=1and0. Revertingparsing.rsfails both new tests with the extension.test_instance_with_aware_datetime_any_tzinfofails on unmodified master too.Pull Request Check List