milvus-io / milvus-sdk-go

Go SDK for Milvus.
Apache License 2.0
326 stars 105 forks source link

[Bug]: QueryIterator with invalid batch size gets error: empty expression should be used with limit #754

Closed ThreadDao closed 2 months ago

ThreadDao commented 3 months ago

Is there an existing issue for this?

Current Behavior

query iterator with invalid batch size: [0, -1] gets error: empty expression should be used with limit Error messages are not intuitive or instructive

test_query.py:3725:


../../../tests20/python_client/venv/lib/python3.8/site-packages/pymilvus/orm/iterator.py:157: in next res = self._conn.query( ../../../tests20/python_client/venv/lib/python3.8/site-packages/pymilvus/decorators.py:140: in handler raise e from e ../../../tests20/python_client/venv/lib/python3.8/site-packages/pymilvus/decorators.py:136: in handler return func(*args, kwargs) ../../../tests20/python_client/venv/lib/python3.8/site-packages/pymilvus/decorators.py:175: in handler return func(self, *args, *kwargs) ../../../tests20/python_client/venv/lib/python3.8/site-packages/pymilvus/decorators.py:115: in handler raise e from e ../../../tests20/python_client/venv/lib/python3.8/site-packages/pymilvus/decorators.py:86: in handler return func(args, kwargs) ../../../tests20/python_client/venv/lib/python3.8/site-packages/pymilvus/client/grpc_handler.py:1485: in query check_status(response.status)


status = error_code: UnexpectedError reason: "invalid max query result window, limit [0] is invalid, should be greater than 0" code: 65535 detail: "invalid max query result window, limit [0] is invalid, should be greater than 0"

def check_status(status: Status):
    if status.code != 0 or status.error_code != 0:
      raise MilvusException(status.code, status.reason, status.error_code)

E pymilvus.exceptions.MilvusException: <MilvusException: (code=65535, message=invalid max query result window, limit [0] is invalid, should be greater than 0)>

Expected Behavior

No response

Steps To Reproduce

No response

Environment

No response

Anything else?

No response

ThreadDao commented 3 months ago

/assign @congqixia

ThreadDao commented 2 months ago

fixed