-
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support time duration more than 23 #64
Merged
davidhewitt
merged 10 commits into
pydantic:main
from
nix010:support-time-duration-more-than-23-hours
Jun 21, 2024
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
2adc047
Support time duration more than 23
nix010 205684e
make parse_minutes_seconds fn
nix010 4d52c86
format
nix010 6e0f818
refactor check datetime format code
nix010 2f07b2f
remove redundant
nix010 32c9a66
refactor
nix010 b09fec0
commit but still with error
nix010 736c831
add fraction test
nix010 cc8a214
refactor and linting
nix010 c15fa26
refactor and linting
nix010 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1153,7 +1153,12 @@ param_tests! { | |
duration_time_fraction: ok => "00:01:03.123", "PT1M3.123S"; | ||
duration_time_extra: err => "00:01:03.123x", ExtraCharacters; | ||
duration_time_timezone: err => "00:01:03x", ExtraCharacters; | ||
duration_time_invalid_hour: err => "24:01:03", OutOfRangeHour; | ||
duration_time_more_than_24_hour: ok => "24:01:03", "P1DT1M3S"; | ||
duration_time_way_more_than_24_hour: ok => "2400000000:01:03", "P273972Y220DT1M3S"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's add a test with microseconds, perhaps, given the new discussion above. |
||
duration_time_way_more_than_24_hour_long_fraction: ok => "2400000000:01:03.654321", "P273972Y220DT1M3.654321S"; | ||
duration_time_invalid_over_limit_hour: err => "100000000000:01:03", DurationHourValueTooLarge; | ||
duration_time_overflow_hour: err => "100000000000000000000000:01:03", DurationHourValueTooLarge; | ||
duration_time_invalid_format_hour: err => "1000xxx000:01:03", InvalidCharHour; | ||
duration_time_invalid_minute: err => "00:60:03", OutOfRangeMinute; | ||
duration_time_invalid_second: err => "00:00:60", OutOfRangeSecond; | ||
duration_time_fraction_too_long: err => "00:00:00.1234567", SecondFractionTooLong; | ||
|
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just as a final thought here, I think it's possible for us to overflow if
hour_part
is too many bytes.I think in a previous version you had a check on the maximum length of
hour_part
, probably we just dropped that during rounds of simplification. Maybe we should reintroduce that?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch. I just added that in again.