Conversation
…fraction A quoted time dropped a fraction with fewer than 3 digits, so Time == "08:30:00.5" compared with 08:30:00. The date and time parser also accepted the zone before the fraction, for example 2024-01-15T08:00:00Z.5. Keep every fraction digit of a quoted time, and read the zone only after the fraction, like ISO 8601. BREAKING CHANGE: a quoted time with a fraction of 1 or 2 digits now keeps the fraction. An unquoted date and time value with the zone before the fraction now throws ParsingException.
This was referenced Oct 1, 2026
Owner
Author
|
This PR had two breaking changes. Two PRs replace it, one change in each PR:
I close this PR. The captain decides on each new PR separately. |
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.
For later consideration in a major version. Do not merge now. #134 restored the v1.14.2 fraction rules to keep v1.x compatible (restore commit
b49ad2b). This PR re-applies the break parts of5c84ef6. The captain decides on this PR separately.Summary
DateTimeFormatParserreads the zone only after the fraction: date, time, fraction, zone.TimeOnlyvalue keeps every fraction digit, like an unquoted value. TherightIsQuotedLiteralargument ofCreateRightExpris removed, because no other code uses it there.v1.14.2 behavior (and main)
2024-01-15T08:00:00Z.5parses."08:30:00.5"and"08:30:00.50"compare with 08:30:00.New behavior
ParsingException."08:30:00.5"is 08:30:00 and 500 milliseconds.Main already accepts these and they do not change: a fraction before the zone, 7 fraction digits, an unquoted time fraction, and a time list.
Example
ParsingException.Justification
.5is half a second. A filter that drops it gives wrong rows without an error. A zone before the fraction is not an ISO 8601 format, and the README shows only ISO 8601 values.Migration
2024-01-15T08:00:00.5Z.README
The date and time format list now tells that a time fraction keeps every digit, and that the zone comes after the fraction.
Tests
These tests come back from main before #134:
FilterParsingRegressionTests.fractional_seconds_are_kept: the casesTime == "08:30:00.5"andTime == "08:30:00.50"expect the fraction again. The v1.14.2 casesZ.5,+02:00.500, and"08:30:00.500"are removed.quoted_time_with_fewer_than_three_fraction_digits_drops_the_fractionis removed. It held the v1.14.2 behavior.FilterParsingRegressionTests.fractional_second_value_matches_by_its_fraction->fractional_seconds_are_kept(Postgres, a quoted.5matches the fraction row again).New unit test:
zone_before_the_fraction_throws(2 cases).dotnet build: 0 warnings, 0 errors.dotnet test: 401 unit tests and 281 Postgres integration tests (Testcontainers) pass, 0 failures.