14
14
)
15
15
from pymilvus .exceptions import ExceptionsMessage , ParamError , ServerVersionIncompatibleException
16
16
from pymilvus .orm .connections import Connections
17
- from pymilvus .orm .constants import MAX_BATCH_SIZE , MILVUS_LIMIT , OFFSET
17
+ from pymilvus .orm .constants import MAX_BATCH_SIZE , OFFSET , UNLIMITED
18
18
from pymilvus .orm .iterator import SearchPage , fall_back_to_latest_session_ts
19
19
20
20
logger = logging .getLogger (__name__ )
@@ -33,6 +33,7 @@ def __init__(
33
33
collection_name : str ,
34
34
data : Union [List , utils .SparseMatrixInputType ],
35
35
batch_size : int = 1000 ,
36
+ limit : Optional [int ] = UNLIMITED ,
36
37
filter : Optional [str ] = None ,
37
38
output_fields : Optional [List [str ]] = None ,
38
39
search_params : Optional [Dict ] = None ,
@@ -44,10 +45,9 @@ def __init__(
44
45
):
45
46
self ._check_params (batch_size , data , kwargs )
46
47
47
- # for compatibility, delete limit from incoming
48
- if MILVUS_LIMIT in kwargs :
49
- self ._left_res_cnt = kwargs [MILVUS_LIMIT ]
50
- del kwargs [MILVUS_LIMIT ]
48
+ # for compatibility, support limit, deprecate in future
49
+ if limit != UNLIMITED :
50
+ self ._left_res_cnt = limit
51
51
52
52
self ._conn = connection
53
53
self ._params = {
0 commit comments