Skip to content

Commit

Permalink
fix: Qdrant collection exists check (#11657)
Browse files Browse the repository at this point in the history
* fix: Qdrant collection exists check

* fix: Handle RpcError
  • Loading branch information
Anush008 authored Mar 6, 2024
1 parent 0f9aaaa commit 0546134
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ def _create_collection(self, collection_name: str, vector_size: int) -> None:
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(
Expand Down Expand Up @@ -408,7 +408,7 @@ async def _acreate_collection(self, collection_name: str, vector_size: int) -> N
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(
Expand Down

0 comments on commit 0546134

Please sign in to comment.