crate / crate/crate-python

Clarify JSON marshalling of `Decimal` values

Đang mở
#751 7 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
85
Fork
34
Merge trung bình
3 ngày 16 giờ
Pull request đã merge (30 ngày)
3

Mô tả

## 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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.