Skip to content

fix: catch OverflowError in parsedate/parsedatetime recipes (fixes #857) - #859

Closed
KooshaPari wants to merge 1 commit into
simonw:mainfrom
KooshaPari:fix-1-overflow
Closed

KooshaPari wants to merge 1 commit into
simonw:mainfrom
KooshaPari:fix-1-overflow

Conversation

@KooshaPari

@KooshaPari KooshaPari commented Sep 13, 2026

Copy link
Copy Markdown

Fixes #857

Changes

  • Catch OverflowError alongside ParserError in both parsedate() and parsedatetime() in sqlite_utils/recipes.py
  • Overflow values like "999999999999999999-01-01" now respect the errors= parameter instead of always raising

Testing

  • Added test_dateparse_overflow_handled to verify errors=SET_NULL returns None and errors=IGNORE returns the original value for overflow inputs
  • Added test_dateparse_overflow_raises to verify the default behavior (no errors=) still raises on overflow
  • All 24 tests in test_recipes.py pass

📚 Documentation preview 📚: https://sqlite-utils--859.org.readthedocs.build/en/859/

Copilot AI lite review requested due to automatic review settings September 13, 2026 06:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@KooshaPari KooshaPari closed this by deleting the head repository Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Date conversion recipes do not apply errors= handling to parser overflows

2 participants