crate / crate/crate-python

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

Abierto
#729 1 comentario 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
85
Forks
34
Merge medio
3 d 16 h
PR fusionados (30 d)
3

Descripción

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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.