graphql-python / graphql-python/graphene
Numpy NaN handling
未关闭
还没有人认领这个 Issue。
✨ enhancement
🙋 help wanted
- 主要语言
- Python
- 星标
- 8.2k
- 派生
- 818
- PR 合并指标
- 30 天内没有已合并 PR
描述
Currently when a `[Float]` type resolves to `np.array([1, np.nan])` the generated payload is `[1, NaN]` which is not json-compilant (rather than `null`) without any warning. A custom scalar can do the job however as numpy is so widely used, maybe this should be supported out of the box?
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先跟踪 Graphene 的 Float 标量或生成的 payload 如何序列化包含 NaN 的 NumPy 数组。复现报告中的 [1, NaN] 输出,并添加覆盖测试,表明 NaN 会作为 JSON null 输出,同时不会破坏正常的浮点数处理。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- numpy, python
- 领域
- api
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100