Repository navigation
Conversation
`SqliteColumnDataSource` parses the text of DATE, TIME, DATETIME and TIMESTAMP columns with `extended_types = TRUE` in the static `parse_date()`, `parse_time()` and `parse_datetime_local()`, which return whether the text could be parsed instead of warning, so that a later Arrow layer can parse the same text and report failures its own way. A date is parsed into whole days, a time or a timestamp into microseconds as written and the UTC offset that follows them, with the checks for a time of day with an offset in the parser. `fetch_date()`, `fetch_time()` and `fetch_datetime_local()` scale these and apply the offset as before, and raise the same warnings once per value for text they can't parse and for blobs. New tests pin the exact values and the warnings of the data-frame path for these columns, including UTC offsets, and that a warning made an error completes the result; they pass before and after this change. Ported from #861 on top of the offset handling of #885. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Hr1rd7QnTD4acgzTUihnF4
`ParsedTime` documents a time without an offset as a signed duration as written, and the parsers document their outputs as unspecified when they return false. The parsers no longer check for a NULL `text`: `fetch_text()` already raises the out-of-memory error for a NULL from SQLite, and the documented contract now requires a non-NULL `text`, so a later caller can't turn an out-of-memory failure into a parse failure. The out-of-memory test for DATE columns now also covers TIME and DATETIME columns. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Hr1rd7QnTD4acgzTUihnF4
…nd a timestamp The test copied the DATE column into TIME and DATETIME columns, so its first row, '2026-01-02', failed to parse as a timestamp and leaked the warning "Unknown string format, NA is returned." into the suite. The first row now holds a valid time and timestamp, and the test asserts that the large value raises the out-of-memory error without a warning. The parsers read through fetch_text(), so the out-of-memory error is raised before any parse. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Hr1rd7QnTD4acgzTUihnF4
This was referenced Dec 1, 2026
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.
No change of behavior.
SqliteColumnDataSourcenow parses the text of DATE, TIME, DATETIME and TIMESTAMP columns read withextended_types = TRUEin the staticparse_date(),parse_time()andparse_datetime_local(), which return a value or a failure without raising a warning.fetch_date(),fetch_time()andfetch_datetime_local()call them and warn as before, with the same texts, once per value. The later Arrow date layer reuses the parsers and reports failed conversions its own way.A date is parsed into whole days. A time or a timestamp is parsed into microseconds as written plus the UTC offset that follows it, if any; the checks that a time with an offset is a time of day (from #885) moved into
parse_time(). The data-frame path applies the offset in seconds after scaling, exactly as today, so values stay bit for bit the same. Applying the offset in integer microseconds inside the parser would have changed the last bit of some values.Testing: two new tests in
test-extendedTypes.Rpin the exact values and the sequence of warnings for DATE, TIME, TIMESTAMP and DATETIME columns (text with and without offsets,Z, fractions, invalid forms, numbers, blobs, NULL), and that a warning turned into an error completes the result. They pass on the base and on this branch. A wider comparison of base and branch over 87 rows of text forms (offsets ±HH:MM,Z, out-of-range offsets and times, fractions, numbers as days or seconds including integer64, blobs) gave identical values, attributes and warnings (166 warnings). Full suite withNOT_CRAN=true: FAIL 0, WARN 3 (locale), SKIP 63, PASS 11455.Layer R5 of the rebuilt chain, planned in #880; based on #951. Ported from #861 (draft), commit 1d77e80, on top of the offset handling of #885; the old pin asserted that a negative offset read as a fraction of a second, which #885 fixed, so the pin asserts today's behavior instead.
Coordinating session: https://claude.ai/code/session_01Hr1rd7QnTD4acgzTUihnF4
Generated by Claude Code