Modify test cases for covering travel timestamp (#10323)

Signed-off-by: Binbin Lv <binbin.lv@zilliz.com>
pull/10329/head
binbin 2021-10-20 22:04:36 +08:00 committed by GitHub
parent de43c1a2ed
commit fc2839f254
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 144 additions and 128 deletions

View File

@ -150,6 +150,7 @@ class TestcaseBase(Base):
vectors = []
binary_raw_vectors = []
insert_ids = []
time_stamp = 0
# 1 create collection
default_schema = cf.gen_default_collection_schema(auto_id=auto_id, dim=dim)
if is_binary:
@ -164,16 +165,15 @@ class TestcaseBase(Base):
cf.gen_partitions(collection_w, partition_num)
# 3 insert data if specified
if insert_data:
collection_w, vectors, binary_raw_vectors, insert_ids = \
cf.insert_data(collection_w, nb, is_binary, is_all_data_type,
auto_id=auto_id, dim=dim)
collection_w, vectors, binary_raw_vectors, insert_ids, time_stamp = \
cf.insert_data(collection_w, nb, is_binary, is_all_data_type, auto_id=auto_id, dim=dim)
assert collection_w.is_empty is False
assert collection_w.num_entities == nb
# This condition will be removed after auto index feature
if not is_index:
collection_w.load()
return collection_w, vectors, binary_raw_vectors, insert_ids
return collection_w, vectors, binary_raw_vectors, insert_ids, time_stamp
def insert_entities_into_two_partitions_in_half(self, half, prefix='query'):
"""

View File

@ -509,12 +509,13 @@ def insert_data(collection_w, nb=3000, is_binary=False, is_all_data_type=False,
if auto_id:
default_data.drop(ct.default_int64_field_name, axis=1, inplace=True)
insert_res = collection_w.insert(default_data, par[i].name)[0]
time_stamp = insert_res.timestamp
insert_ids.extend(insert_res.primary_keys)
vectors.append(default_data)
start = start + nb // num
log.info("insert_data: inserted data into collection %s (num_entities: %s)"
% (collection_w.name, nb))
return collection_w, vectors, binary_raw_vectors, insert_ids
return collection_w, vectors, binary_raw_vectors, insert_ids, time_stamp
def _check_primary_keys(primary_keys, nb):

View File

@ -13,7 +13,7 @@ pytest-print==0.2.1
pytest-level==0.1.1
pytest-xdist==2.2.1
# pytest-parallel
pymilvus==2.0.0rc8.dev9
pymilvus==2.0.0rc8.dev12
pytest-rerunfailures==9.1.1
git+https://github.com/Projectplace/pytest-tags
ndg-httpsclient

View File

@ -32,7 +32,7 @@ class TestDeleteParams(TestcaseBase):
expected: assert num entities
"""
# init collection with default_nb default data
collection_w, _, _, ids = self.init_collection_general(prefix, insert_data=True, is_binary=is_binary)
collection_w, _, _, ids = self.init_collection_general(prefix, insert_data=True, is_binary=is_binary)[0:4]
expr = f'{ct.default_int64_field_name} in {ids[:half_nb]}'
# delete half of data
@ -123,10 +123,11 @@ class TestDeleteParams(TestcaseBase):
expected: num entities becomes zero
"""
# init collection with default_nb default data
collection_w, _, _, ids = self.init_collection_general(prefix, insert_data=True)
collection_w, _, _, ids = self.init_collection_general(prefix, insert_data=True)[0:4]
expr = f'{ct.default_int64_field_name} in {ids}'
del_res, _ = collection_w.delete(expr)
assert del_res.delete_count == ct.default_nb
assert collection_w.num_entities == 0
assert collection_w.is_empty

View File

@ -932,7 +932,7 @@ class TestQueryOperation(TestcaseBase):
limit = 1000
nb_old = 500
collection_w, vectors, binary_raw_vectors, insert_ids = \
self.init_collection_general(prefix, True, nb_old)
self.init_collection_general(prefix, True, nb_old)[0:4]
# 2. search for original data after load
vectors_s = [[random.random() for _ in range(ct.default_dim)] for _ in range(ct.default_nq)]

View File

@ -281,7 +281,7 @@ class TestCollectionSearchInvalid(TestcaseBase):
if index == "FLAT":
pytest.skip("skip in FLAT index")
# 1. initialize with data
collection_w, _, _, insert_ids = self.init_collection_general(prefix, True, 5000,
collection_w, _, _, insert_ids, _ = self.init_collection_general(prefix, True, 5000,
is_index=True)
# 2. create index and load
default_index = {"index_type": index, "params": params, "metric_type": "L2"}
@ -552,7 +552,7 @@ class TestCollectionSearchInvalid(TestcaseBase):
expected: searched successfully
"""
# 1. initialize with data
collection_w, _, _, insert_ids = self.init_collection_general(prefix, True, 5000,
collection_w, _, _, insert_ids, _ = self.init_collection_general(prefix, True, 5000,
partition_num=1,
is_index=True)
# 2. create different index
@ -641,7 +641,7 @@ class TestCollectionSearchInvalid(TestcaseBase):
expected: raise exception
"""
# 1. initialize with data
collection_w, _, _, insert_ids = self.init_collection_general(prefix, True)
collection_w, _, _, insert_ids, _ = self.init_collection_general(prefix, True)
# 2. search
log.info("test_search_with_output_fields_not_exist: Searching collection %s" % collection_w.name)
collection_w.search(vectors[:default_nq], default_search_field,
@ -730,7 +730,7 @@ class TestCollectionSearch(TestcaseBase):
expected: search successfully with limit(topK)
"""
# 1. initialize with data
collection_w, _, _, insert_ids = \
collection_w, _, _, insert_ids, time_stamp = \
self.init_collection_general(prefix, True, auto_id=auto_id, dim=dim)
# 2. search
log.info("test_search_normal: searching collection %s" % collection_w.name)
@ -738,6 +738,7 @@ class TestCollectionSearch(TestcaseBase):
collection_w.search(vectors[:nq], default_search_field,
default_search_params, default_limit,
default_search_exp,
travel_timestamp=time_stamp,
check_task=CheckTasks.check_search_results,
check_items={"nq": nq,
"ids": insert_ids,
@ -750,7 +751,7 @@ class TestCollectionSearch(TestcaseBase):
method: create connections,collection insert and search vectors in collections
expected: search successfully with limit(topK) and can be hit at top 1 (min distance is 0)
"""
collection_w, _vectors, _, insert_ids = \
collection_w, _vectors, _, insert_ids, _ = \
self.init_collection_general(prefix, True, auto_id=auto_id, dim=dim)
# get vectors that inserted into collection
vectors = np.array(_vectors[0]).tolist()
@ -796,7 +797,7 @@ class TestCollectionSearch(TestcaseBase):
expected: search successfully with limit(topK)
"""
# 1. initialize with data
collection_w, _, _, insert_ids = \
collection_w, _, _, insert_ids, _ = \
self.init_collection_general(prefix, True, auto_id=auto_id, dim=dim)
# 2. search
log.info("test_search_normal: searching collection %s" % collection_w.name)
@ -804,6 +805,7 @@ class TestCollectionSearch(TestcaseBase):
collection_w.search(vectors[:default_nq], default_search_field,
search_params, default_limit,
default_search_exp, _async=_async,
travel_timestamp=0,
check_task=CheckTasks.check_search_results,
check_items={"nq": default_nq,
"ids": insert_ids,
@ -823,7 +825,7 @@ class TestCollectionSearch(TestcaseBase):
nb = 1000
limit = 1000
partition_num = 1
collection_w, _, _, insert_ids = self.init_collection_general(prefix, True, nb,
collection_w, _, _, insert_ids, _ = self.init_collection_general(prefix, True, nb,
partition_num,
auto_id=auto_id,
dim=dim)
@ -870,7 +872,7 @@ class TestCollectionSearch(TestcaseBase):
nb = 1000
limit = 1000
partition_num = 1
collection_w, _, _, insert_ids = self.init_collection_general(prefix, True, nb,
collection_w, _, _, insert_ids, _ = self.init_collection_general(prefix, True, nb,
partition_num,
auto_id=auto_id,
dim=dim)
@ -916,7 +918,7 @@ class TestCollectionSearch(TestcaseBase):
# 1. initialize with data
nb = 1000
limit = 1000
collection_w, _, _, insert_ids = self.init_collection_general(prefix, True, nb,
collection_w, _, _, insert_ids, _ = self.init_collection_general(prefix, True, nb,
1, auto_id=auto_id,
dim=dim)
# 2. search all the partitions before partition deletion
@ -957,7 +959,7 @@ class TestCollectionSearch(TestcaseBase):
expected: search successfully
"""
# 1. initialize without data
collection_w, _, _, insert_ids = self.init_collection_general(prefix, True, nb,
collection_w, _, _, insert_ids, time_stamp = self.init_collection_general(prefix, True, nb,
1, auto_id=auto_id,
dim=dim)
# 2. release collection
@ -971,6 +973,7 @@ class TestCollectionSearch(TestcaseBase):
vectors = [[random.random() for _ in range(dim)] for _ in range(nq)]
collection_w.search(vectors[:nq], default_search_field, default_search_params,
default_limit, default_search_exp, _async=_async,
travel_timestamp=time_stamp,
check_task=CheckTasks.check_search_results,
check_items={"nq": nq,
"ids": insert_ids,
@ -989,7 +992,7 @@ class TestCollectionSearch(TestcaseBase):
expected: search successfully
"""
# 1. initialize without data
collection_w, _, _, insert_ids = self.init_collection_general(prefix, True, nb,
collection_w, _, _, insert_ids, time_stamp = self.init_collection_general(prefix, True, nb,
1, auto_id=auto_id,
dim=dim)
# 2. release collection
@ -1005,6 +1008,7 @@ class TestCollectionSearch(TestcaseBase):
vectors = [[random.random() for _ in range(dim)] for _ in range(nq)]
collection_w.search(vectors[:nq], default_search_field, default_search_params,
limit, default_search_exp, _async=_async,
travel_timestamp=time_stamp,
check_task=CheckTasks.check_search_results,
check_items={"nq": nq,
"ids": insert_ids,
@ -1018,6 +1022,7 @@ class TestCollectionSearch(TestcaseBase):
collection_w.search(vectors[:nq], default_search_field, default_search_params,
limit, default_search_exp,
[par[1].name], _async=_async,
travel_timestamp=time_stamp,
check_task=CheckTasks.check_search_results,
check_items={"nq": nq,
"ids": insert_ids[par[0].num_entities:],
@ -1065,7 +1070,7 @@ class TestCollectionSearch(TestcaseBase):
# 1. initialize with data
limit = 1000
nb_old = 500
collection_w, _, _, insert_ids = self.init_collection_general(prefix, True, nb_old,
collection_w, _, _, insert_ids, time_stamp = self.init_collection_general(prefix, True, nb_old,
auto_id=auto_id,
dim=dim)
# 2. search for original data after load
@ -1074,6 +1079,7 @@ class TestCollectionSearch(TestcaseBase):
collection_w.search(vectors[:nq], default_search_field,
default_search_params, limit,
default_search_exp, _async=_async,
travel_timestamp=time_stamp+1,
check_task=CheckTasks.check_search_results,
check_items={"nq": nq,
"ids": insert_ids,
@ -1081,8 +1087,9 @@ class TestCollectionSearch(TestcaseBase):
"_async": _async})
# 3. insert new data
nb_new = 300
insert_ids_new = cf.insert_data(collection_w, nb_new,
auto_id=auto_id, dim=dim, insert_offset=nb_old)[3]
_, _, _, insert_ids_new, time_stamp = cf.insert_data(collection_w, nb_new,
auto_id=auto_id, dim=dim,
insert_offset=nb_old)
insert_ids.extend(insert_ids_new)
# gracefulTime is default as 1s which allows data
# could not be searched instantly in gracefulTime
@ -1091,6 +1098,7 @@ class TestCollectionSearch(TestcaseBase):
collection_w.search(vectors[:nq], default_search_field,
default_search_params, limit,
default_search_exp, _async=_async,
travel_timestamp=time_stamp,
check_task=CheckTasks.check_search_results,
check_items={"nq": nq,
"ids": insert_ids,
@ -1105,7 +1113,7 @@ class TestCollectionSearch(TestcaseBase):
expected: search successfully with limit(topK)
"""
# 1. initialize with data
collection_w, _, _, insert_ids = self.init_collection_general(prefix, True, 100,
collection_w, _, _, insert_ids, _ = self.init_collection_general(prefix, True, 100,
auto_id=auto_id,
dim=max_dim)
# 2. search
@ -1132,7 +1140,7 @@ class TestCollectionSearch(TestcaseBase):
expected: search successfully with limit(topK)
"""
# 1. initialize with data
collection_w, _, _, insert_ids = self.init_collection_general(prefix, True, 5000,
collection_w, _, _, insert_ids, time_stamp = self.init_collection_general(prefix, True, 5000,
partition_num=1,
auto_id=auto_id,
dim=dim, is_index=True)
@ -1154,6 +1162,7 @@ class TestCollectionSearch(TestcaseBase):
collection_w.search(vectors[:default_nq], default_search_field,
search_param, default_limit,
default_search_exp, _async=_async,
travel_timestamp=time_stamp,
check_task=CheckTasks.check_search_results,
check_items={"nq": default_nq,
"ids": insert_ids,
@ -1171,7 +1180,7 @@ class TestCollectionSearch(TestcaseBase):
expected: searched successfully
"""
# 1. initialize with data
collection_w, _, _, insert_ids = self.init_collection_general(prefix, True, 5000,
collection_w, _, _, insert_ids, time_stamp = self.init_collection_general(prefix, True, 5000,
partition_num=1,
auto_id=auto_id,
dim=dim, is_index=True)
@ -1195,6 +1204,7 @@ class TestCollectionSearch(TestcaseBase):
collection_w.search(vectors[:default_nq], default_search_field,
search_param, default_limit,
default_search_exp, _async=_async,
travel_timestamp=time_stamp,
check_task=CheckTasks.check_search_results,
check_items={"nq": default_nq,
"ids": insert_ids,
@ -1209,7 +1219,7 @@ class TestCollectionSearch(TestcaseBase):
expected: searched successfully
"""
# 1. initialize with data
collection_w, _, _, insert_ids = self.init_collection_general(prefix, True, nb,
collection_w, _, _, insert_ids, _ = self.init_collection_general(prefix, True, nb,
auto_id=auto_id,
dim=dim)
# 2. search for multiple times
@ -1234,7 +1244,7 @@ class TestCollectionSearch(TestcaseBase):
expected: search successfully with limit(topK)
"""
# 1. initialize with data
collection_w, _, _, insert_ids = self.init_collection_general(prefix, True, nb,
collection_w, _, _, insert_ids, time_stamp = self.init_collection_general(prefix, True, nb,
auto_id=auto_id,
dim=dim)
# 2. search
@ -1246,6 +1256,7 @@ class TestCollectionSearch(TestcaseBase):
collection_w.search(vectors[:nq], default_search_field,
default_search_params, default_limit,
default_search_exp, _async=_async,
travel_timestamp=time_stamp,
check_task=CheckTasks.check_search_results,
check_items={"nq": nq,
"ids": insert_ids,
@ -1308,7 +1319,7 @@ class TestCollectionSearch(TestcaseBase):
expected: searched successfully
"""
# 1. initialize with data
collection_w, _, _, insert_ids = self.init_collection_general(prefix, True, nb,
collection_w, _, _, insert_ids, time_stamp = self.init_collection_general(prefix, True, nb,
partition_num=1,
auto_id=auto_id,
is_index=True)
@ -1329,6 +1340,7 @@ class TestCollectionSearch(TestcaseBase):
collection_w.search(vectors[:default_nq], default_search_field,
search_params, limit, default_search_exp,
[par[1].name], _async=_async,
travel_timestamp=time_stamp,
check_task=CheckTasks.check_search_results,
check_items={"nq": default_nq,
"ids": insert_ids[par[0].num_entities:],
@ -1343,7 +1355,7 @@ class TestCollectionSearch(TestcaseBase):
expected: searched successfully
"""
# 1. initialize with data
collection_w, _, _, insert_ids = self.init_collection_general(prefix, True, nb,
collection_w, _, _, insert_ids, _ = self.init_collection_general(prefix, True, nb,
partition_num=1,
auto_id=auto_id,
dim=dim,
@ -1378,7 +1390,7 @@ class TestCollectionSearch(TestcaseBase):
expected: searched successfully
"""
# 1. initialize with data
collection_w, _, _, insert_ids = self.init_collection_general(prefix, True, nb,
collection_w, _, _, insert_ids, _ = self.init_collection_general(prefix, True, nb,
partition_num=1,
auto_id=auto_id,
dim=dim)
@ -1446,7 +1458,7 @@ class TestCollectionSearch(TestcaseBase):
expected: the return distance equals to the computed value
"""
# 1. initialize with binary data
collection_w, _, binary_raw_vector, insert_ids = self.init_collection_general(prefix, True, 2,
collection_w, _, binary_raw_vector, insert_ids, time_stamp = self.init_collection_general(prefix, True, 2,
is_binary=True,
auto_id=auto_id,
dim=dim,
@ -1464,6 +1476,7 @@ class TestCollectionSearch(TestcaseBase):
res = collection_w.search(binary_vectors[:nq], "binary_vector",
search_params, default_limit, "int64 >= 0",
_async=_async,
travel_timestamp=time_stamp,
check_task=CheckTasks.check_search_results,
check_items={"nq": nq,
"ids": insert_ids,
@ -1483,7 +1496,7 @@ class TestCollectionSearch(TestcaseBase):
expected: the return distance equals to the computed value
"""
# 1. initialize with binary data
collection_w, _, binary_raw_vector, insert_ids = self.init_collection_general(prefix, True, 2,
collection_w, _, binary_raw_vector, insert_ids, _ = self.init_collection_general(prefix, True, 2,
is_binary=True,
auto_id=auto_id,
dim=dim,
@ -1521,7 +1534,7 @@ class TestCollectionSearch(TestcaseBase):
expected: the return distance equals to the computed value
"""
# 1. initialize with binary data
collection_w, _, binary_raw_vector, insert_ids = self.init_collection_general(prefix, True, 2,
collection_w, _, binary_raw_vector, insert_ids, _ = self.init_collection_general(prefix, True, 2,
is_binary=True,
auto_id=auto_id,
dim=dim,
@ -1560,7 +1573,7 @@ class TestCollectionSearch(TestcaseBase):
"""
# 1. initialize with data
nb = 1000
collection_w, _vectors, _, insert_ids = self.init_collection_general(prefix, True,
collection_w, _vectors, _, insert_ids, _ = self.init_collection_general(prefix, True,
nb, dim=dim,
is_index=True)
@ -1610,7 +1623,7 @@ class TestCollectionSearch(TestcaseBase):
"""
# 1. initialize with data
nb = 1000
collection_w, _vectors, _, insert_ids = self.init_collection_general(prefix, True, nb,
collection_w, _vectors, _, insert_ids, _ = self.init_collection_general(prefix, True, nb,
is_all_data_type=True,
auto_id=auto_id,
dim=dim)
@ -1663,7 +1676,7 @@ class TestCollectionSearch(TestcaseBase):
"""
# 1. initialize with data
nb = 1000
collection_w, _vectors, _, insert_ids = self.init_collection_general(prefix, True, nb,
collection_w, _vectors, _, insert_ids, _ = self.init_collection_general(prefix, True, nb,
auto_id=True,
dim=dim,
is_index=True)
@ -1710,7 +1723,7 @@ class TestCollectionSearch(TestcaseBase):
expected: search success
"""
# 1. initialize with data
collection_w, _, _, insert_ids = self.init_collection_general(prefix, True, nb,
collection_w, _, _, insert_ids, _ = self.init_collection_general(prefix, True, nb,
is_all_data_type=True,
auto_id=auto_id,
dim=dim)
@ -1743,7 +1756,7 @@ class TestCollectionSearch(TestcaseBase):
expected: search success
"""
# 1. initialize with data
collection_w, _, _, insert_ids = self.init_collection_general(prefix, True, nb,
collection_w, _, _, insert_ids, _ = self.init_collection_general(prefix, True, nb,
auto_id=auto_id,
dim=dim)
# 2. search
@ -1771,7 +1784,7 @@ class TestCollectionSearch(TestcaseBase):
expected: search success
"""
# 1. initialize with data
collection_w, _, _, insert_ids = self.init_collection_general(prefix, True,
collection_w, _, _, insert_ids, _ = self.init_collection_general(prefix, True,
auto_id=auto_id)
# 2. search
log.info("test_search_with_output_field: Searching collection %s" % collection_w.name)
@ -1799,7 +1812,7 @@ class TestCollectionSearch(TestcaseBase):
expected: search success
"""
# 1. initialize with data
collection_w, _, _, insert_ids = self.init_collection_general(prefix, True, nb,
collection_w, _, _, insert_ids, _ = self.init_collection_general(prefix, True, nb,
is_all_data_type=True,
auto_id=auto_id,
dim=dim)
@ -1831,7 +1844,7 @@ class TestCollectionSearch(TestcaseBase):
expected: search success
"""
# 1. initialize with data
collection_w, _, _, insert_ids = self.init_collection_general(prefix, True,
collection_w, _, _, insert_ids, _ = self.init_collection_general(prefix, True,
auto_id=auto_id)
# 2. search
log.info("test_search_with_output_field_wildcard: Searching collection %s" % collection_w.name)
@ -1863,7 +1876,7 @@ class TestCollectionSearch(TestcaseBase):
for i in range(collection_num):
# 1. initialize with data
log.info("test_search_multi_collections: search round %d" % (i + 1))
collection_w, _, _, insert_ids = self.init_collection_general(prefix, True, nb,
collection_w, _, _, insert_ids, _ = self.init_collection_general(prefix, True, nb,
auto_id=auto_id,
dim=dim)
# 2. search
@ -1889,7 +1902,7 @@ class TestCollectionSearch(TestcaseBase):
# 1. initialize with data
threads_num = 10
threads = []
collection_w, _, _, insert_ids = self.init_collection_general(prefix, True, nb,
collection_w, _, _, insert_ids, time_stamp = self.init_collection_general(prefix, True, nb,
auto_id=auto_id,
dim=dim)
@ -1898,6 +1911,7 @@ class TestCollectionSearch(TestcaseBase):
collection_w.search(vectors[:nq], default_search_field,
default_search_params, default_limit,
default_search_exp, _async=_async,
travel_timestamp=time_stamp,
check_task=CheckTasks.check_search_results,
check_items={"nq": nq,
"ids": insert_ids,

View File

@ -470,7 +470,7 @@ class TestUtilityParams(TestcaseBase):
"""
self._connect()
nb = 10
collection_w, vectors, _, insert_ids = self.init_collection_general(prefix, True, nb,
collection_w, vectors, _, insert_ids, _ = self.init_collection_general(prefix, True, nb,
is_index=True)
middle = len(insert_ids) // 2
op_l = {"ids": insert_ids[:middle], "collection": collection_w.name,
@ -1048,7 +1048,7 @@ class TestUtilityBase(TestcaseBase):
log.info("Creating connection")
self._connect()
nb = 10
collection_w, vectors, _, insert_ids = self.init_collection_general(prefix, True, nb)
collection_w, vectors, _, insert_ids, _ = self.init_collection_general(prefix, True, nb)
middle = len(insert_ids) // 2
vectors = vectors[0].loc[:, default_field_name]
vectors_l = vectors[:middle]
@ -1081,8 +1081,8 @@ class TestUtilityBase(TestcaseBase):
nb = 10
prefix_1 = "utility_distance"
log.info("Creating two collections")
collection_w, vectors, _, insert_ids = self.init_collection_general(prefix, True, nb)
collection_w_1, vectors_1, _, insert_ids_1 = self.init_collection_general(prefix_1, True, nb)
collection_w, vectors, _, insert_ids, _ = self.init_collection_general(prefix, True, nb)
collection_w_1, vectors_1, _, insert_ids_1, _ = self.init_collection_general(prefix_1, True, nb)
vectors_l = vectors[0].loc[:, default_field_name]
vectors_r = vectors_1[0].loc[:, default_field_name]
log.info("Extracting entities from collections for distance calculating")
@ -1109,7 +1109,7 @@ class TestUtilityBase(TestcaseBase):
log.info("Creating connection")
self._connect()
nb = 10
collection_w, vectors, _, insert_ids = self.init_collection_general(prefix, True, nb)
collection_w, vectors, _, insert_ids, _ = self.init_collection_general(prefix, True, nb)
middle = len(insert_ids) // 2
vectors = vectors[0].loc[:, default_field_name]
vectors_l = cf.gen_vectors(nb, default_dim)
@ -1139,7 +1139,7 @@ class TestUtilityBase(TestcaseBase):
log.info("Creating connection")
self._connect()
nb = 10
collection_w, vectors, _, insert_ids = self.init_collection_general(prefix, True, nb)
collection_w, vectors, _, insert_ids, _ = self.init_collection_general(prefix, True, nb)
middle = len(insert_ids) // 2
vectors = vectors[0].loc[:, default_field_name]
vectors_l = vectors[:middle]
@ -1167,7 +1167,7 @@ class TestUtilityBase(TestcaseBase):
log.info("Creating connection")
self._connect()
nb = 10
collection_w, vectors, _, insert_ids = self.init_collection_general(prefix, True, nb, partition_num=1)
collection_w, vectors, _, insert_ids, _ = self.init_collection_general(prefix, True, nb, partition_num=1)
partitions = collection_w.partitions
middle = len(insert_ids) // 2
params = {metric_field: metric, "sqrt": sqrt}
@ -1201,7 +1201,7 @@ class TestUtilityBase(TestcaseBase):
log.info("Create connection")
self._connect()
nb = 10
collection_w, vectors, _, insert_ids = self.init_collection_general(prefix, True, nb, partition_num=1)
collection_w, vectors, _, insert_ids, _ = self.init_collection_general(prefix, True, nb, partition_num=1)
partitions = collection_w.partitions
middle = len(insert_ids) // 2
params = {metric_field: metric, "sqrt": sqrt}
@ -1230,7 +1230,7 @@ class TestUtilityBase(TestcaseBase):
log.info("Creating connection")
self._connect()
nb = 10
collection_w, vectors, _, insert_ids = self.init_collection_general(prefix, True, nb, partition_num=1)
collection_w, vectors, _, insert_ids, _ = self.init_collection_general(prefix, True, nb, partition_num=1)
middle = len(insert_ids) // 2
partitions = collection_w.partitions
vectors_l = cf.gen_vectors(nb // 2, default_dim)
@ -1262,7 +1262,7 @@ class TestUtilityBase(TestcaseBase):
"""
self._connect()
nb = 10
collection_w, vectors, _, insert_ids = self.init_collection_general(prefix, True, nb, partition_num=1)
collection_w, vectors, _, insert_ids, _ = self.init_collection_general(prefix, True, nb, partition_num=1)
middle = len(insert_ids) // 2
partitions = collection_w.partitions
vectors_r = cf.gen_vectors(nb // 2, default_dim)