crate / crate/crate-python

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

Open
#729 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
85
Forks
34
Avg merge
3d 16h
Merged PRs (30d)
3

Description

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.