batch insert fails the whole batch with "ValueError: Unexpected type" when a value is a Decimal
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- python
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Python
- スター
- 230
- フォーク
- 173
- 平均マージ
- 4日 16時間
- マージ済み PR(30日)
- 23
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
weaviate/weaviate-python-client のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
weaviate/weaviate-python-client#2265 ·
メンテナーはふだん 1 日以内に返信
-
Batch: re-added rate-limited objects stay in results.objs.all_responses as errors対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
weaviate/weaviate-python-client#2179 ·
メンテナーはふだん 1 日以内に返信
-
collections/batch: one object that fails client-side encoding fails every object sent with it対応中かも @shadowmodder が今日担当しました。 オープンbug
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
weaviate/weaviate-python-client#2266 ·
メンテナーはふだん 1 日以内に返信
-
collections/batch/sync.py: after a fast hang-up reconnect the old stream's sender steals a request, hanging add_object対応中かも @shadowmodder が 2 日前に担当しました。 オープンbug
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
weaviate/weaviate-python-client#2261 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
weaviate/weaviate-python-client#2259 ·
メンテナーはふだん 1 日以内に返信
weaviate/weaviate-python-client の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
-
breaking change
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
it-at-m/lhm_actions#441 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
TigreGotico/euskaphone#68 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] arc_agi_2: a correct grid in the format the prompt asks for scores 0 (exact_match gold is a one-line list)対応中かも @BahaaMattar が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
huggingface/lighteval#1510 ·
メンテナーはふだん 1 日以内に返信