batch insert fails the whole batch with "ValueError: Unexpected type" when a value is a Decimal
Mantenedores costumam responder em até 1 dia
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Estagnada
- Stack de tecnologia
- python
- Domínio
- backend-api-design
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Python
- Estrelas
- 230
- Forks
- 173
- Merge médio
- 4d 16h
- PRs com merge (30d)
- 23
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de weaviate/weaviate-python-client
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
weaviate/weaviate-python-client#2265 ·
Mantenedores costumam responder em até 1 dia
-
Batch: re-added rate-limited objects stay in results.objs.all_responses as errorsTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
weaviate/weaviate-python-client#2179 ·
Mantenedores costumam responder em até 1 dia
-
collections/batch: one object that fails client-side encoding fails every object sent with itTalvez já em andamento @shadowmodder assumiu hoje. Abertabug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 72/100
weaviate/weaviate-python-client#2266 ·
Mantenedores costumam responder em até 1 dia
-
collections/batch/sync.py: after a fast hang-up reconnect the old stream's sender steals a request, hanging add_objectTalvez já em andamento @shadowmodder assumiu há 2 dias. Abertabug
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 45/100
weaviate/weaviate-python-client#2261 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
weaviate/weaviate-python-client#2259 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de weaviate/weaviate-python-client
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
Deltares/numba_celltree#100 · 1 comentário ·
-
auto-reported bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 63/100
Mantenedores costumam responder em até 1 dia
-
soup airgap-bundle --bundle-size-cap nan, inf or a cap above ~1.67e299 GiB stops with an internal ValueError/OverflowError (exit 1) instead of a usage errorTalvez já em andamento @Keshemir assumiu hoje. Abertabug claimed difficulty:2
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
MakazhanAlpamys/Soup#3045 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
dagster-io/skills#80 ·
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia