Skip to content

Commit

Permalink
Change error_code to code
Browse files Browse the repository at this point in the history
Signed-off-by: Enwei Jiao <enwei.jiao@zilliz.com>
  • Loading branch information
jiaoew1991 committed Sep 15, 2023
1 parent 1ae931f commit 3753d9b
Show file tree
Hide file tree
Showing 8 changed files with 272 additions and 272 deletions.
30 changes: 15 additions & 15 deletions pymilvus/client/asynch.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,11 @@ def exception(self):

class SearchFuture(Future):
def on_response(self, response: Any):
if response.status.error_code == 0:
if response.status.code == 0:
return QueryResult(response)

status = response.status
raise MilvusException(status.error_code, status.reason)
raise MilvusException(status.code, status.reason)


# TODO: if ChunkedFuture is more common later, consider using ChunkedFuture as Base Class,
Expand Down Expand Up @@ -246,28 +246,28 @@ def exception(self):

def on_response(self, response: Any):
for raw in response:
if raw.status.error_code != 0:
raise MilvusException(raw.status.error_code, raw.status.reason)
if raw.status.code != 0:
raise MilvusException(raw.status.code, raw.status.reason)

return ChunkedQueryResult(response)


class MutationFuture(Future):
def on_response(self, response: Any):
status = response.status
if status.error_code == 0:
if status.code == 0:
return MutationResult(response)

status = response.status
raise MilvusException(status.error_code, status.reason)
raise MilvusException(status.code, status.reason)


class CreateIndexFuture(Future):
def on_response(self, response: Any):
if response.error_code != 0:
raise MilvusException(response.error_code, response.reason)
if response.code != 0:
raise MilvusException(response.code, response.reason)

return Status(response.error_code, response.reason)
return Status(response.code, response.reason)


class CreateFlatIndexFuture(AbstractFuture):
Expand Down Expand Up @@ -327,17 +327,17 @@ def exception(self):

class FlushFuture(Future):
def on_response(self, response: Any):
if response.status.error_code != 0:
raise MilvusException(response.status.error_code, response.status.reason)
if response.status.code != 0:
raise MilvusException(response.status.code, response.status.reason)


class LoadCollectionFuture(Future):
def on_response(self, response: Any):
if response.error_code != 0:
raise MilvusException(response.error_code, response.reason)
if response.code != 0:
raise MilvusException(response.code, response.reason)


class LoadPartitionsFuture(Future):
def on_response(self, response: Any):
if response.error_code != 0:
raise MilvusException(response.error_code, response.reason)
if response.code != 0:
raise MilvusException(response.code, response.reason)
Loading

0 comments on commit 3753d9b

Please sign in to comment.