Skip to content

Commit e5f92d0

Browse files
authored
Merge pull request #1566 from weaviate/20250225-suggest-updated-error
Suggestion re: error msg
2 parents dcc9f3f + 36566a8 commit e5f92d0

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

integration/test_named_vectors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -767,15 +767,15 @@ def test_deprecated_syntax(collection_factory: CollectionFactory):
767767
target_vector=["first", "second", "second"],
768768
return_metadata=wvc.query.MetadataQuery.full(),
769769
)
770-
assert "Providing lists of lists has been deprecated" in str(e)
770+
assert "This input appears to be a nested list of embeddings." in str(e)
771771

772772
with pytest.raises(WeaviateInvalidInputError) as e:
773773
collection.query.near_vector(
774774
[[0.0, 1.0], [1.0, 0.0, 0.0]],
775775
target_vector=["first", "second"],
776776
return_metadata=wvc.query.MetadataQuery.full(),
777777
)
778-
assert "Providing lists of lists has been deprecated" in str(e)
778+
assert "This input appears to be a nested list of embeddings." in str(e)
779779

780780

781781
@pytest.mark.parametrize(

weaviate/collections/grpc/shared.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,10 @@ def _vector_per_target(
151151
return None, struct.pack("{}f".format(len(near_vector)), *near_vector)
152152
else:
153153
raise WeaviateInvalidInputError(
154-
"""Providing lists of lists has been deprecated. Please provide a dictionary with target names as
155-
keys and lists of numbers as values."""
154+
"""This input appears to be a nested list of embeddings.
155+
If you are trying to search with a multi-vector embedding, check the shape of your input.
156+
If you are trying to provide multiple target vectors,
157+
provide a dictionary with target names as keys and embeddings as values."""
156158
)
157159

158160
def _vector_for_target(
@@ -282,8 +284,10 @@ def add_list_of_vectors(value: _ListOfVectorsQuery, key: str) -> None:
282284
return None, struct.pack("{}f".format(len(near_vector)), *near_vector), None
283285
else:
284286
raise WeaviateInvalidInputError(
285-
"""Providing lists of lists has been deprecated. Please provide a dictionary with target names as
286-
keys and lists of numbers as values."""
287+
"""This input appears to be a nested list of embeddings.
288+
If you are trying to search with a multi-vector embedding, check the shape of your input.
289+
If you are trying to provide multiple target vectors,
290+
provide a dictionary with target names as keys and embeddings as values."""
287291
)
288292

289293
def _parse_near_options(

0 commit comments

Comments
 (0)