batch insert fails the whole batch with "ValueError: Unexpected type" when a value is a Decimal
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- python
- Área
- backend-api-design
Línea de trabajo
Start with _serialize_primitive in collections/batch/grpc_batch.py and compare its handling of unsupported values with the data.insert error described in the issue. Check the existing batch serialization tests and add coverage for decimal.Decimal and numpy.float32; done means these values produce a clear WeaviateInvalidInputError. Pull request #2264 is already open for this issue.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
ran into this in a singer target. the singer sdk parses json numbers as decimal.Decimal, and postgres numeric columns come back as Decimal through psycopg too, so probably not just me.
data.insert gives a clear error:
WeaviateInvalidInputError: Invalid input provided: Cannot serialize value of type <class 'decimal.Decimal'> to Weaviate..
the grpc paths don't. insert_many raises ValueError: Unexpected type from inside protobuf, and the batch context managers just log it. every object in that batch ends up in failed_objects, including the good ones:
with col.batch.fixed_size(batch_size=100) as batch:
for i in range(99):
batch.add_object({"price": float(i)})
batch.add_object({"price": Decimal("9.99")})
len(col.batch.failed_objects) # 100
len(col) # 0
the message doesn't say which property or type it was, so it's hard to track down.
cause is _serialize_primitive in collections/batch/grpc_batch.py. it passes anything it doesn't handle straight to Struct.update. numpy.float32 hits the same thing.
weaviate-client 4.24.1, weaviate 1.40.5, python 3.13
i'll put up a PR that raises the same WeaviateInvalidInputError as data.insert. one bad value would still fail the whole batch after that, which felt like a bigger change so i left it alone. can take a look at that too if you want.
- Lenguaje dominante
- Python
- Estrellas
- 230
- Forks
- 173
- Merge medio
- 4 d 16 h
- PR fusionados (30 d)
- 23
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de weaviate/weaviate-python-client
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
weaviate/weaviate-python-client#2265 ·
Los mantenedores suelen responder en 1 día
-
Batch: re-added rate-limited objects stay in results.objs.all_responses as errorsPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
weaviate/weaviate-python-client#2179 ·
Los mantenedores suelen responder en 1 día
-
collections/batch: one object that fails client-side encoding fails every object sent with itPosiblemente ocupada @shadowmodder la tomó hoy. Abiertobug
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
weaviate/weaviate-python-client#2266 ·
Los mantenedores suelen responder en 1 día
-
collections/batch/sync.py: after a fast hang-up reconnect the old stream's sender steals a request, hanging add_objectPosiblemente ocupada @shadowmodder la tomó hace 2 días. Abiertobug
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
weaviate/weaviate-python-client#2261 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
weaviate/weaviate-python-client#2259 ·
Los mantenedores suelen responder en 1 día
Todos los issues de weaviate/weaviate-python-client
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
-
breaking change
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
it-at-m/lhm_actions#441 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
TigreGotico/euskaphone#68 ·
Los mantenedores suelen responder en 1 día
-
[BUG] arc_agi_2: a correct grid in the format the prompt asks for scores 0 (exact_match gold is a one-line list)Posiblemente ocupada @BahaaMattar la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
huggingface/lighteval#1510 ·
Los mantenedores suelen responder en 1 día