Date conversion recipes do not apply errors= handling to parser overflows
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
定位 parsedate() 和 parsedatetime() recipe 及其现有测试;先阅读它们如何处理 ParserError 和 errors= 模式。为两个 recipe 添加使用 SET_NULL 和 IGNORE 处理超大数值日期的覆盖,并确认默认行为仍会重新抛出 OverflowError。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Python
- 星标
- 2.2k
- 派生
- 172
- 平均合并
- 9 分钟
- 30 天内合并 PR
- 1
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
simonw/sqlite-utils 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
simonw/sqlite-utils#876 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 90/100
simonw/sqlite-utils#872 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 92/100
simonw/sqlite-utils#849 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
simonw/sqlite-utils#588 · 4 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
bug documentation help wanted
难度 1/5 1 小时以内 新手友好度 88/100
simonw/sqlite-utils#493 · 5 条评论 ·
维护者通常 1 天内回复
查看 simonw/sqlite-utils 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
-
bug
难度 1/5 1 小时以内 新手友好度 88/100
qgis/QGIS-Plugins-Website#459 ·
-
bug severity:medium
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复
-
bot-found bug priority: P3
难度 2/5 1-3 小时 新手友好度 84/100
madenvel/KalinkaPlayer#179 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
ls1intum/edutelligence#1098 ·
维护者通常 1 天内回复