batch insert fails the whole batch with "ValueError: Unexpected type" when a value is a Decimal
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- python
- Bereich
- backend-api-design
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Python
- Sterne
- 230
- Forks
- 173
- Ø Merge
- 4 T. 16 Std.
- Gemergte PRs (30 T.)
- 23
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus weaviate/weaviate-python-client
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
weaviate/weaviate-python-client#2265 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Batch: re-added rate-limited objects stay in results.objs.all_responses as errorsEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
weaviate/weaviate-python-client#2179 ·
Maintainer antworten meist innerhalb von 1 Tag
-
collections/batch: one object that fails client-side encoding fails every object sent with itEvtl. vergeben @shadowmodder hat das heute übernommen. Offenbug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 72/100
weaviate/weaviate-python-client#2266 ·
Maintainer antworten meist innerhalb von 1 Tag
-
collections/batch/sync.py: after a fast hang-up reconnect the old stream's sender steals a request, hanging add_objectEvtl. vergeben @shadowmodder hat das vor 2 Tagen übernommen. Offenbug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
weaviate/weaviate-python-client#2261 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
weaviate/weaviate-python-client#2259 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in weaviate/weaviate-python-client
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 67/100
-
breaking change
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 84/100
it-at-m/lhm_actions#441 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
TigreGotico/euskaphone#68 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[BUG] arc_agi_2: a correct grid in the format the prompt asks for scores 0 (exact_match gold is a one-line list)Evtl. vergeben @BahaaMattar hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
huggingface/lighteval#1510 ·
Maintainer antworten meist innerhalb von 1 Tag