TypeError: Type is not JSON serializable: `numpy.ndarray`/`recarray`
- 主要语言
- Python
- 星标
- 85
- 派生
- 34
- 平均合并
- 3 天 16 小时
- 30 天内合并 PR
- 3
描述
## 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
贡献指南
调研方向
Start with the cratedb-orjson.py reproduction linked in the issue and inspect how crate-python handles decoded payloads containing numpy.ndarray or recarray values. Confirm the failure with array/list data read through pandas or Polars; done means those payloads serialize without the reported TypeError.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- numpy, pandas, python
- 领域
- database
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100