batch insert fails the whole batch with "ValueError: Unexpected type" when a value is a Decimal
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- python
- Lĩnh vực
- backend-api-design
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 230
- Fork
- 173
- Merge trung bình
- 4 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 23
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của weaviate/weaviate-python-client
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
weaviate/weaviate-python-client#2265 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Batch: re-added rate-limited objects stay in results.objs.all_responses as errorsCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
weaviate/weaviate-python-client#2179 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
collections/batch: one object that fails client-side encoding fails every object sent with itCó thể đã có người làm @shadowmodder đã nhận hôm nay. Đang mởbug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
weaviate/weaviate-python-client#2266 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
collections/batch/sync.py: after a fast hang-up reconnect the old stream's sender steals a request, hanging add_objectCó thể đã có người làm @shadowmodder đã nhận 2 ngày trước. Đang mởbug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
weaviate/weaviate-python-client#2261 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
weaviate/weaviate-python-client#2259 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của weaviate/weaviate-python-client
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
-
breaking change
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
it-at-m/lhm_actions#441 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
TigreGotico/euskaphone#68 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] arc_agi_2: a correct grid in the format the prompt asks for scores 0 (exact_match gold is a one-line list)Có thể đã có người làm @BahaaMattar đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
huggingface/lighteval#1510 ·
Maintainer thường phản hồi trong vòng 1 ngày