From 6c589dcd0123c80ef8d319a9f35cb9de6fb50e7b Mon Sep 17 00:00:00 2001 From: hh-space-invader Date: Tue, 15 Oct 2024 22:39:19 +0300 Subject: [PATCH] fix: Raise if named vector not found in local mode --- qdrant_client/local/async_qdrant_local.py | 2 ++ qdrant_client/local/qdrant_local.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/qdrant_client/local/async_qdrant_local.py b/qdrant_client/local/async_qdrant_local.py index ab131cf3..ce6450ec 100644 --- a/qdrant_client/local/async_qdrant_local.py +++ b/qdrant_client/local/async_qdrant_local.py @@ -722,6 +722,8 @@ 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() diff --git a/qdrant_client/local/qdrant_local.py b/qdrant_client/local/qdrant_local.py index 8a74d357..35d610db 100644 --- a/qdrant_client/local/qdrant_local.py +++ b/qdrant_client/local/qdrant_local.py @@ -766,6 +766,8 @@ 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()