Skip to content

Commit

Permalink
fix index error code
Browse files Browse the repository at this point in the history
Signed-off-by: zhuwenxing <[email protected]>
  • Loading branch information
zhuwenxing committed Oct 16, 2023
1 parent c4a05a7 commit f96b908
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pymilvus/client/grpc_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ def list_indexes(self, collection_name: str, timeout: Optional[float] = None, **
status = response.status
if status.code == 0:
return response.index_descriptions
if status.code == Status.INDEX_NOT_EXIST:
if status.code in [Status.INDEX_NOT_EXIST, Status.INDEX_NOT_FOUND]:
return []
raise MilvusException(status.code, status.reason, status.error_code)

Expand All @@ -930,7 +930,7 @@ def describe_index(
rf = self._stub.DescribeIndex.future(request, timeout=timeout)
response = rf.result()
status = response.status
if status.code == Status.INDEX_NOT_EXIST:
if status.code in [Status.INDEX_NOT_EXIST, Status.INDEX_NOT_FOUND]:
return None
if status.code != 0:
raise MilvusException(status.code, status.reason)
Expand Down
1 change: 1 addition & 0 deletions pymilvus/client/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class Status:
OUT_OF_MEMORY = 24
INDEX_NOT_EXIST = 25
EMPTY_COLLECTION = 26
INDEX_NOT_FOUND = 700

def __init__(self, code: int = SUCCESS, message: str = "Success") -> None:
self.code = code
Expand Down

0 comments on commit f96b908

Please sign in to comment.