未验证 提交 121cf7fc 编写于 作者: N NicoYuan1986 提交者: GitHub

Add pagination cases of query without limit (#20062)

Signed-off-by: Nnico <cheng.yuan@zilliz.com>
Signed-off-by: Nnico <cheng.yuan@zilliz.com>
上级 d5bc4e25
...@@ -215,11 +215,10 @@ class TestIndexOperation(TestcaseBase): ...@@ -215,11 +215,10 @@ class TestIndexOperation(TestcaseBase):
assert collection_w.indexes[0].params["index_type"] == default_index_params["index_type"] assert collection_w.indexes[0].params["index_type"] == default_index_params["index_type"]
@pytest.mark.tags(CaseLabel.L1) @pytest.mark.tags(CaseLabel.L1)
@pytest.mark.xfail(reason="issue 19972")
def test_index_create_indexes_for_different_fields(self): def test_index_create_indexes_for_different_fields(self):
""" """
target: Test create indexes for different fields target: Test create indexes for different fields
method: create two different indexes method: create two different indexes with default index name
expected: create successfully expected: create successfully
""" """
collection_w = self.init_collection_general(prefix, True, is_index=True)[0] collection_w = self.init_collection_general(prefix, True, is_index=True)[0]
......
...@@ -997,6 +997,28 @@ class TestQueryParams(TestcaseBase): ...@@ -997,6 +997,28 @@ class TestQueryParams(TestcaseBase):
collection_w.query(default_term_expr, params=query_params, collection_w.query(default_term_expr, params=query_params,
check_task=CheckTasks.check_query_results, check_items={exp_res: res}) 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.tags(CaseLabel.L2)
@pytest.mark.xfail(reason="issue #19482") @pytest.mark.xfail(reason="issue #19482")
@pytest.mark.parametrize("limit", ["12 s", " ", [0, 1], {2}]) @pytest.mark.parametrize("limit", ["12 s", " ", [0, 1], {2}])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册