mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-11-29 18:38:44 +08:00
update pymilvus version (#27791)
Signed-off-by: nico <cheng.yuan@zilliz.com>
This commit is contained in:
parent
a693af014f
commit
6e6de17a8c
@ -12,7 +12,7 @@ allure-pytest==2.7.0
|
||||
pytest-print==0.2.1
|
||||
pytest-level==0.1.1
|
||||
pytest-xdist==2.5.0
|
||||
pymilvus==2.3.1.post1.dev8
|
||||
pymilvus==2.3.1.post1.dev18
|
||||
pytest-rerunfailures==9.1.1
|
||||
git+https://github.com/Projectplace/pytest-tags
|
||||
ndg-httpsclient
|
||||
|
@ -3061,23 +3061,22 @@ class TestDescribeCollection(TestcaseBase):
|
||||
collection_w.create_index(ct.default_float_vec_field_name, index_params=ct.default_flat_index)
|
||||
description = \
|
||||
{'collection_name': c_name, 'auto_id': False, 'num_shards': ct.default_shards_num, 'description': '',
|
||||
'fields': [{'field_id': 100, 'name': 'int64', 'description': '', 'type': 5,
|
||||
'params': {}, 'is_primary': True, 'element_type': 0,},
|
||||
'fields': [{'field_id': 100, 'name': 'int64', 'description': '', 'type': 5, 'params': {},
|
||||
'is_primary': True, 'element_type': 0, "auto_id": False, "is_partition_key": False,
|
||||
"is_dynamic": False},
|
||||
{'field_id': 101, 'name': 'float', 'description': '', 'type': 10, 'params': {},
|
||||
'element_type': 0,},
|
||||
'element_type': 0},
|
||||
{'field_id': 102, 'name': 'varchar', 'description': '', 'type': 21,
|
||||
'params': {'max_length': 65535}, 'element_type': 0,},
|
||||
'params': {'max_length': 65535}, 'element_type': 0},
|
||||
{'field_id': 103, 'name': 'json_field', 'description': '', 'type': 23, 'params': {},
|
||||
'element_type': 0,},
|
||||
'element_type': 0},
|
||||
{'field_id': 104, 'name': 'float_vector', 'description': '', 'type': 101,
|
||||
'params': {'dim': 128}, 'element_type': 0}],
|
||||
'aliases': [], 'consistency_level': 0, 'properties': [], 'num_partitions': 1}
|
||||
'aliases': [], 'consistency_level': 0, 'properties': [], 'num_partitions': 1,
|
||||
"enable_dynamic_field": False}
|
||||
res = collection_w.describe()[0]
|
||||
del res['collection_id']
|
||||
log.info(res)
|
||||
assert description['fields'] == res['fields'], description['aliases'] == res['aliases']
|
||||
del description['fields'], res['fields'], description['aliases'], res['aliases']
|
||||
del description['properties'], res['properties']
|
||||
assert description == res
|
||||
|
||||
|
||||
|
@ -405,17 +405,18 @@ class TestInsertParams(TestcaseBase):
|
||||
collection_w = self.init_collection_wrap(name=c_name)
|
||||
nb = 10
|
||||
int_values = pd.Series(data=[i for i in range(nb)])
|
||||
float_values = pd.Series(data=[float(i)
|
||||
for i in range(nb)], dtype="float32")
|
||||
float_values = pd.Series(data=[float(i) for i in range(nb)], dtype="float32")
|
||||
float_vec_values = cf.gen_vectors(nb, ct.default_dim)
|
||||
df = pd.DataFrame({
|
||||
ct.default_float_field_name: float_values,
|
||||
ct.default_float_vec_field_name: float_vec_values,
|
||||
ct.default_int64_field_name: int_values
|
||||
})
|
||||
error = {ct.err_code: 1, ct.err_msg: "The fields don't match with schema fields"}
|
||||
collection_w.insert(
|
||||
data=df, check_task=CheckTasks.err_res, check_items=error)
|
||||
error = {ct.err_code: 1,
|
||||
ct.err_msg: "The fields don't match with schema fields, expected: ['int64', 'float', "
|
||||
"'varchar', 'json_field', 'float_vector'], got ['float', 'float_vector', "
|
||||
"'int64']"}
|
||||
collection_w.insert(data=df, check_task=CheckTasks.err_res, check_items=error)
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L2)
|
||||
def test_insert_inconsistent_data(self):
|
||||
|
@ -1523,8 +1523,7 @@ class TestCollectionSearch(TestcaseBase):
|
||||
insert_res, _ = collection_w.insert(insert_data[0])
|
||||
insert_ids.extend(insert_res.primary_keys)
|
||||
# search
|
||||
vectors = [[random.random() for _ in range(dim)]
|
||||
for _ in range(default_nq)]
|
||||
vectors = [[random.random() for _ in range(dim)] for _ in range(default_nq)]
|
||||
search_res, _ = collection_w.search(vectors[:nq], default_search_field,
|
||||
default_search_params, default_limit,
|
||||
default_search_exp, _async=_async,
|
||||
@ -3220,9 +3219,8 @@ class TestCollectionSearch(TestcaseBase):
|
||||
if _async:
|
||||
res.done()
|
||||
res = res.result()
|
||||
assert len(res[0][0].entity._row_data) != 0
|
||||
assert (default_int64_field_name and default_float_field_name and default_bool_field_name) \
|
||||
in res[0][0].entity._row_data
|
||||
in res[0][0].fields
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L1)
|
||||
@pytest.mark.parametrize("field", ct.all_scalar_data_types[:3])
|
||||
@ -3482,7 +3480,7 @@ class TestCollectionSearch(TestcaseBase):
|
||||
output_fields=[binary_field_name])[0]
|
||||
|
||||
# 4. check the result vectors should be equal to the inserted
|
||||
assert res[0][0].entity.binary_vector == [data[binary_field_name][res[0][0].id]]
|
||||
assert res[0][0].entity.binary_vector == data[binary_field_name][res[0][0].id]
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L2)
|
||||
@pytest.mark.parametrize("metrics", ct.structure_metrics)
|
||||
@ -3515,7 +3513,7 @@ class TestCollectionSearch(TestcaseBase):
|
||||
output_fields=[binary_field_name])[0]
|
||||
|
||||
# 4. check the result vectors should be equal to the inserted
|
||||
assert res[0][0].entity.binary_vector == [data[binary_field_name][res[0][0].id]]
|
||||
assert res[0][0].entity.binary_vector == data[binary_field_name][res[0][0].id]
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L2)
|
||||
@pytest.mark.parametrize("dim", [32, 128, 768])
|
||||
@ -7441,7 +7439,7 @@ class TestCollectionRangeSearch(TestcaseBase):
|
||||
res.done()
|
||||
res = res.result()
|
||||
assert len(res[0][0].entity._row_data) != 0
|
||||
assert default_int64_field_name in res[0][0].entity._row_data
|
||||
assert default_int64_field_name in res[0][0].fields
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L2)
|
||||
def test_range_search_concurrent_multi_threads(self, nb, nq, dim, auto_id, _async):
|
||||
|
Loading…
Reference in New Issue
Block a user