crate / crate/crate-python

TypeError: Type is not JSON serializable: `numpy.ndarray`/`recarray`

Đang mở
#729 1 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ả

## Problem
We probed JSON serialization with `crate-python` and discovered it does not work well in all situations yet, for example when the data payload includes an array/list, and is read from JSON using pandas or Polars.

```json
{"foo":"bar","baz":["qux"]}
```

The reason is that the decoded payload includes `numpy.ndarray` or `recarray` types.

## Reproduce
[`cratedb-orjson.py`](https://gist.github.com/amotl/f55474d633e7c71498c24ce3ca4c6332) can be used to reproduce the problem.

## References
- https://github.com/crate/cratedb-toolkit/issues/482

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.