From 0546134bf01eb0d89c26b978759a81c3f54f49c9 Mon Sep 17 00:00:00 2001
From: Anush <anushshetty90@gmail.com>
Date: Thu, 7 Mar 2024 00:48:15 +0530
Subject: [PATCH] fix: Qdrant collection exists check (#11657)

* fix: Qdrant collection exists check

* fix: Handle RpcError
---
 .../llama_index/vector_stores/qdrant/base.py                  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/llama-index-integrations/vector_stores/llama-index-vector-stores-qdrant/llama_index/vector_stores/qdrant/base.py b/llama-index-integrations/vector_stores/llama-index-vector-stores-qdrant/llama_index/vector_stores/qdrant/base.py
index 5f2100f3b..1ef137ae3 100644
--- a/llama-index-integrations/vector_stores/llama-index-vector-stores-qdrant/llama_index/vector_stores/qdrant/base.py
+++ b/llama-index-integrations/vector_stores/llama-index-vector-stores-qdrant/llama_index/vector_stores/qdrant/base.py
@@ -370,7 +370,7 @@ class QdrantVectorStore(BasePydanticVectorStore):
                         distance=rest.Distance.COSINE,
                     ),
                 )
-        except (ValueError, UnexpectedResponse) as exc:
+        except (RpcError, ValueError, UnexpectedResponse) as exc:
             if "already exists" not in str(exc):
                 raise exc  # noqa: TRY201
             logger.warning(
@@ -408,7 +408,7 @@ class QdrantVectorStore(BasePydanticVectorStore):
                         distance=rest.Distance.COSINE,
                     ),
                 )
-        except (ValueError, UnexpectedResponse) as exc:
+        except (RpcError, ValueError, UnexpectedResponse) as exc:
             if "already exists" not in str(exc):
                 raise exc  # noqa: TRY201
             logger.warning(
-- 
GitLab