parsedate() and parsedatetime() support errors=r.IGNORE and errors=r.SET_NULL for values that cannot be parsed, but they currently only catch dateutil.parser.ParserError.
dateutil.parser.parse() can also raise OverflowError for malformed values with numeric components too large for the underlying date representation. For example:
from sqlite_utils import recipes
value = "999999999999999999999999999999-01-01"
recipes.parsedate(value, errors=recipes.SET_NULL)
Currently this raises OverflowError instead of returning None. The same happens with parsedatetime(), and errors=recipes.IGNORE also fails to return the original value.
A focused fix would treat OverflowError the same as ParserError inside these two recipes while preserving the existing default behavior of re-raising when errors is not set. Targeted tests can cover both recipes and both error-handling modes.
parsedate()andparsedatetime()supporterrors=r.IGNOREanderrors=r.SET_NULLfor values that cannot be parsed, but they currently only catchdateutil.parser.ParserError.dateutil.parser.parse()can also raiseOverflowErrorfor malformed values with numeric components too large for the underlying date representation. For example:Currently this raises
OverflowErrorinstead of returningNone. The same happens withparsedatetime(), anderrors=recipes.IGNOREalso fails to return the original value.A focused fix would treat
OverflowErrorthe same asParserErrorinside these two recipes while preserving the existing default behavior of re-raising whenerrorsis not set. Targeted tests can cover both recipes and both error-handling modes.