From 0af764aa4092ed4e24221170a0cb239c6433a3aa Mon Sep 17 00:00:00 2001 From: rtmalikian Date: Sat, 27 Jun 2026 00:14:15 -0700 Subject: [PATCH] fix: convert NumPy arrays and other vector types in insert_many (Fixes #1002) insert_many() in executor.py constructs _BatchObject directly without converting the vector, causing NumPy arrays, torch tensors, and other supported vector types to be silently discarded. The fix applies _get_vector_v4() conversion (same as BatchObject.__init__) before storing the vector in _BatchObject. Also handles named vectors (dict[str, vector]) by converting each value. Signed-off-by: rtmalikian --- weaviate/collections/data/executor.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/weaviate/collections/data/executor.py b/weaviate/collections/data/executor.py index 688d2cc98..2d02da3ce 100644 --- a/weaviate/collections/data/executor.py +++ b/weaviate/collections/data/executor.py @@ -177,7 +177,13 @@ def insert_many( ( _BatchObject( collection=self.name, - vector=obj.vector, + vector=( + {key: _get_vector_v4(val) for key, val in obj.vector.items()} + if isinstance(obj.vector, dict) + else _get_vector_v4(obj.vector) + if obj.vector is not None + else None + ), uuid=str(obj.uuid if obj.uuid is not None else uuid_package.uuid4()), properties=cast(dict, obj.properties), tenant=self._tenant,