Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Binding a Decimal infinity to a compiled statement raises OverflowError

未关闭 适合新手
#154 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
84/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
database

调研方向

从 drivine/cypher/sql/parameters.py 中的 _jsonable(第 110 行)开始;issue 指出 Decimal 值在这里转换。比较对 Decimal("NaN") 和 float 无穷大的处理方式,然后追踪编译后语句的参数传递路径,直到到达此函数。完成标准是 Decimal 正无穷和负无穷都能绑定为 float 无穷大,且不会引发 OverflowError;issue 没有指定测试文件,因此请找到或添加覆盖此路径的测试。

由索引模型根据 Issue 内容生成。

描述

bug

A parameter bound as Decimal("Infinity") or Decimal("-Infinity") to a statement compiled to SQL raises OverflowError: cannot convert Infinity to integer from drivine/cypher/sql/parameters.py:110 (_jsonable). This happens for any statement, before the compiler reads what the parameter is for.

The review of #120 found it with round(1234.5, $p) and p = Decimal("-Infinity"). It predates that change.

A float infinity is read as one. A Decimal infinity should be too: read it as a float infinity, as Decimal("NaN") is read as NaN, rather than converted to an integer.

drivine4j and drivine have no Decimal parameter type, so no port is needed.

主要语言
Python
星标
1
派生
0
平均合并
1 小时 16 分钟
30 天内合并 PR
74

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

liberation-data/drivine-python 的其他 Issue

查看 liberation-data/drivine-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。