insert_many silently discards vectors if they're NumPy arrays

Open Beginner friendly
#1,002 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
numpy, python
Domain
api, backend

Research direction

Start at weaviate/collections/batch/grpc_batch_objects.py line 60 and trace the insert_many handling for DataObject vectors. Reproduce the case with a NumPy array, then verify that the completed behavior either preserves the vector as floats or reports an explicit error. Add regression coverage for the chosen behavior.

Written by the indexing model from the issue text.

Description

bug

If I have a collection c and call c.data.insert_many on a list[DataObject], each of which with the vector field set to a NumPy array, the upload returns without error but silently discards the vectors. The line that causes this behavior is here.

I would expect the NumPy array to be interpreted as a list of floats. Or, if this is undesirable for some reason, passing a NumPy array as a vector should result in an error.

Dominant language
Python
Stars
227
Forks
151
Avg merge
3d 14h
Merged PRs (30d)
11

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from weaviate/weaviate-python-client

All issues in weaviate/weaviate-python-client

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.