diff --git a/shards/mishards/db_base.py b/shards/mishards/db_base.py index 6754f5c80a..a80c95aa2f 100644 --- a/shards/mishards/db_base.py +++ b/shards/mishards/db_base.py @@ -29,7 +29,7 @@ class DB: self.engine = create_engine(url) else: self.engine = create_engine(uri, pool_size=pool_size, - pool_recycle=pool_size, + pool_recycle=pool_recycle, pool_timeout=pool_timeout, pool_pre_ping=pool_pre_ping, echo=echo, diff --git a/shards/mishards/exception_handlers.py b/shards/mishards/exception_handlers.py index c79a6db5a3..e7e0bfc4cb 100644 --- a/shards/mishards/exception_handlers.py +++ b/shards/mishards/exception_handlers.py @@ -24,8 +24,11 @@ def resp_handler(err, error_code): if resp_class == milvus_pb2.VectorIds: return resp_class(status=status, vector_id_array=[]) - if resp_class == milvus_pb2.TopKQueryResultList: - return resp_class(status=status, topk_query_result=[]) + if resp_class == milvus_pb2.TopKQueryResult: + return resp_class(status=status, + row_num=0, + ids=[], + distances=[]) if resp_class == milvus_pb2.TableRowCount: return resp_class(status=status, table_row_count=-1)