Skip to content

Commit

Permalink
fix: Raise if named vector not found in local mode while upsert
Browse files Browse the repository at this point in the history
  • Loading branch information
hh-space-invader committed Oct 17, 2024
1 parent 6c589dc commit 728ce36
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions qdrant_client/local/async_qdrant_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -722,8 +722,6 @@ async def upsert(
self, collection_name: str, points: types.Points, **kwargs: Any
) -> types.UpdateResult:
collection = self._get_collection(collection_name)
if not collection.vectors_config:
raise ValueError("Wrong input: Not existing vector name error")
collection.upsert(points)
return self._default_update_result()

Expand Down
2 changes: 2 additions & 0 deletions qdrant_client/local/local_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -2148,6 +2148,8 @@ def _upsert_point(self, point: models.PointStruct) -> None:
"Wrong input: Unnamed vectors are not allowed when a collection has named vectors or multivectors: "
f"{vector_names}, {multivector_names}"
)
if not self.vectors and not self.multivectors:
raise ValueError(f"Wrong input: Not existing vector name error")

if point.id in self.ids:
self._update_point(point)
Expand Down
2 changes: 0 additions & 2 deletions qdrant_client/local/qdrant_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -766,8 +766,6 @@ def upsert(
self, collection_name: str, points: types.Points, **kwargs: Any
) -> types.UpdateResult:
collection = self._get_collection(collection_name)
if not collection.vectors_config:
raise ValueError("Wrong input: Not existing vector name error")
collection.upsert(points)
return self._default_update_result()

Expand Down

0 comments on commit 728ce36

Please sign in to comment.