mirror of https://github.com/milvus-io/milvus.git
Add pagination cases of query without limit (#20062)
Signed-off-by: nico <cheng.yuan@zilliz.com> Signed-off-by: nico <cheng.yuan@zilliz.com>pull/20149/head
parent
d5bc4e2585
commit
121cf7fc7b
|
@ -215,11 +215,10 @@ class TestIndexOperation(TestcaseBase):
|
|||
assert collection_w.indexes[0].params["index_type"] == default_index_params["index_type"]
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L1)
|
||||
@pytest.mark.xfail(reason="issue 19972")
|
||||
def test_index_create_indexes_for_different_fields(self):
|
||||
"""
|
||||
target: Test create indexes for different fields
|
||||
method: create two different indexes
|
||||
method: create two different indexes with default index name
|
||||
expected: create successfully
|
||||
"""
|
||||
collection_w = self.init_collection_general(prefix, True, is_index=True)[0]
|
||||
|
|
|
@ -997,6 +997,28 @@ class TestQueryParams(TestcaseBase):
|
|||
collection_w.query(default_term_expr, params=query_params,
|
||||
check_task=CheckTasks.check_query_results, check_items={exp_res: res})
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L1)
|
||||
def test_query_pagination_without_limit(self, offset):
|
||||
"""
|
||||
target: test query pagination without limit
|
||||
method: create collection and query with pagination params(only offset),
|
||||
compare the result with query without pagination params
|
||||
expected: query successfully
|
||||
"""
|
||||
collection_w, vectors = self.init_collection_general(prefix, insert_data=True)[0:2]
|
||||
int_values = vectors[0][ct.default_int64_field_name].values.tolist()
|
||||
pos = 10
|
||||
term_expr = f'{ct.default_int64_field_name} in {int_values[offset: pos + offset]}'
|
||||
res = vectors[0].iloc[offset:pos + offset, :1].to_dict('records')
|
||||
query_params = {"offset": offset}
|
||||
query_res = collection_w.query(term_expr, params=query_params,
|
||||
check_task=CheckTasks.check_query_results,
|
||||
check_items={exp_res: res})[0]
|
||||
res = collection_w.query(term_expr,
|
||||
check_task=CheckTasks.check_query_results,
|
||||
check_items={exp_res: res})[0]
|
||||
assert query_res == res
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L2)
|
||||
@pytest.mark.xfail(reason="issue #19482")
|
||||
@pytest.mark.parametrize("limit", ["12 s", " ", [0, 1], {2}])
|
||||
|
|
Loading…
Reference in New Issue