Skip to content

Commit

Permalink
test: add query expr test for larger int (milvus-io#29599)
Browse files Browse the repository at this point in the history
issue: milvus-io#29570 
add query expr test for larger int

Signed-off-by: elstic <[email protected]>
  • Loading branch information
elstic authored Jan 2, 2024
1 parent 5f00bad commit 0db6b26
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/python_client/testcases/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,28 @@ def test_query_expr_by_bool_field(self):
for _r in res:
assert _r[ct.default_bool_field_name] == bool_value

@pytest.mark.tags(CaseLabel.L2)
def test_query_expr_by_int64(self):
"""
target: test query through int64 field and output int64 field
method: use int64 as query expr parameter
expected: verify query output number
"""
self._connect()
df = cf.gen_default_dataframe_data(nb=ct.default_nb*10)
self.collection_wrap.construct_from_dataframe(cf.gen_unique_str(prefix), df,
primary_field=ct.default_int64_field_name)
assert self.collection_wrap.num_entities == ct.default_nb * 10
self.collection_wrap.create_index(ct.default_float_vec_field_name, index_params=ct.default_flat_index)
self.collection_wrap.load()

# filter on int64 fields
expr_list = [f'{ct.default_int64_field_name} > 8192 && {ct.default_int64_field_name} < 8194',
f'{ct.default_int64_field_name} > 16384 && {ct.default_int64_field_name} < 16386']
for expr in expr_list:
res, _ = self.collection_wrap.query(expr, output_fields=[ct.default_int64_field_name])
assert len(res) == 1

@pytest.mark.tags(CaseLabel.L1)
def test_query_expr_by_int8_field(self):
"""
Expand Down

0 comments on commit 0db6b26

Please sign in to comment.