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

Clarify JSON marshalling of `Decimal` values

未关闭
#751 7 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
停滞
技术栈
python
领域
api, databases

调研方向

阅读 src/crate/client/http.py 的第 105-106 行,然后比较链接的 meltano-target-cratedb 参考内容和 issue #52 中所示的 Decimal 处理方式。确定 Decimal 值所需的 JSON 表示形式,并记录或测试约定的行为;当该表示形式得到明确说明并经过一致验证时,issue 即完成。

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

描述

About

How to marshal values of Python's Decimal type.

Status quo

Currently, the library is conveying Decimal values as strings.

https://github.com/crate/crate-python/blob/7c7a88521d48a9d5225dbd3842f3c4c07fafd4d8/src/crate/client/http.py#L105-L106

See also

Others apparently need serialization to float.

        if isinstance(obj, Decimal):
            return float(obj)

-- https://github.com/crate-workbench/meltano-target-cratedb/blob/148a2d5ec7131658c1a74aed7d91f23befc81341/target_cratedb/sqlalchemy/patch.py#L65-L66

References

主要语言
Python
星标
85
派生
34
平均合并
3 天 1 小时
30 天内合并 PR
4

贡献指南

打开贡献指南

从这里开始

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

crate/crate-python 的其他 Issue

查看 crate/crate-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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