crate / crate/crate-python

Clarify JSON marshalling of `Decimal` values

オープン
#751 コメント 7 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
85
フォーク
34
平均マージ
3日 16時間
マージ済み PR(30日)
3

説明

## About

How to marshal values of Python's [Decimal](https://docs.python.org/3/library/decimal.html) 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.

```python
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

- https://github.com/crate-workbench/meltano-target-cratedb/issues/52

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。