Skip to content

Commit

Permalink
test: update pymilvus version
Browse files Browse the repository at this point in the history
Signed-off-by: nico <[email protected]>
  • Loading branch information
NicoYuan1986 committed Jul 22, 2024
1 parent 4e95f38 commit 9b4bd17
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
4 changes: 2 additions & 2 deletions tests/python_client/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ allure-pytest==2.7.0
pytest-print==0.2.1
pytest-level==0.1.1
pytest-xdist==2.5.0
pymilvus==2.4.4rc11
pymilvus[bulk_writer]==2.4.4rc11
pymilvus==2.4.5rc7
pymilvus[bulk_writer]==2.4.5rc7
pytest-rerunfailures==9.1.1
git+https://github.com/Projectplace/pytest-tags
ndg-httpsclient
Expand Down
7 changes: 5 additions & 2 deletions tests/python_client/testcases/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
default_schema = cf.gen_default_collection_schema()
default_field_name = ct.default_float_vec_field_name
default_index_params = ct.default_index
default_autoindex_params = {"index_type": "AUTOINDEX", "metric_type": "COSINE"}
default_autoindex_params = {"index_type": "AUTOINDEX", "metric_type": "COSINE",
'indexed_rows': 0, 'pending_index_rows': 0, 'state': 3, 'total_rows': 0}
default_sparse_autoindex_params = {"index_type": "AUTOINDEX", "metric_type": "IP"}

# copied from pymilvus
Expand Down Expand Up @@ -2100,6 +2101,7 @@ def test_create_autoindex_with_params(self, index_params):
expect_autoindex_params = index_params
if index_params.get("metric_type"):
expect_autoindex_params["metric_type"] = index_params["metric_type"]
expect_autoindex_params.update({'indexed_rows': 0, 'pending_index_rows': 0, 'state': 3, 'total_rows': 0})
assert actual_index_params == expect_autoindex_params

@pytest.mark.tags(CaseLabel.L2)
Expand All @@ -2126,7 +2128,8 @@ def test_create_autoindex_on_binary_vectors(self):
"""
collection_w = self.init_collection_general(prefix, is_binary=True, is_index=False)[0]
collection_w.create_index(binary_field_name, {})
assert collection_w.index()[0].params == {'index_type': 'AUTOINDEX', 'metric_type': 'HAMMING'}
assert collection_w.index()[0].params == {'index_type': 'AUTOINDEX', 'metric_type': 'HAMMING',
'indexed_rows': 0, 'pending_index_rows': 0, 'state': 3, 'total_rows': 0}


@pytest.mark.tags(CaseLabel.GPU)
Expand Down
25 changes: 13 additions & 12 deletions tests/python_client/testcases/test_insert.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,9 +587,9 @@ def test_insert_create_index(self):
ct.default_float_vec_field_name, default_index_params)
assert collection_w.has_index()[0]
index, _ = collection_w.index()
assert index == Index(
collection_w.collection, ct.default_float_vec_field_name, default_index_params)
assert collection_w.indexes[0] == index
assert index.params == {'index_type': 'AUTOINDEX', 'metric_type': 'COSINE', 'params': {},
'total_rows': ct.default_nb, 'indexed_rows': ct.default_nb, 'pending_index_rows': 0,
'state': 3}

@pytest.mark.tags(CaseLabel.L1)
def test_insert_after_create_index(self):
Expand All @@ -604,9 +604,9 @@ def test_insert_after_create_index(self):
ct.default_float_vec_field_name, default_index_params)
assert collection_w.has_index()[0]
index, _ = collection_w.index()
assert index == Index(
collection_w.collection, ct.default_float_vec_field_name, default_index_params)
assert collection_w.indexes[0] == index
assert index.params == {'index_type': 'AUTOINDEX', 'metric_type': 'COSINE', 'params': {}, 'total_rows': 0,
'indexed_rows': 0, 'pending_index_rows': 0, 'state': 3}
# assert collection_w.indexes[0] == index
df = cf.gen_default_dataframe_data(ct.default_nb)
collection_w.insert(data=df)
assert collection_w.num_entities == ct.default_nb
Expand All @@ -625,9 +625,9 @@ def test_insert_binary_after_index(self):
ct.default_binary_vec_field_name, default_binary_index_params)
assert collection_w.has_index()[0]
index, _ = collection_w.index()
assert index == Index(
collection_w.collection, ct.default_binary_vec_field_name, default_binary_index_params)
assert collection_w.indexes[0] == index
assert index.params == {'index_type': 'AUTOINDEX', 'params': {}, 'metric_type': 'JACCARD', 'total_rows': 0,
'indexed_rows': 0, 'pending_index_rows': 0, 'state': 3}
# assert collection_w.indexes[0] == index
df, _ = cf.gen_default_binary_dataframe_data(ct.default_nb)
collection_w.insert(data=df)
assert collection_w.num_entities == ct.default_nb
Expand All @@ -653,9 +653,10 @@ def test_insert_auto_id_create_index(self):
ct.default_float_vec_field_name, default_index_params)
assert collection_w.has_index()[0]
index, _ = collection_w.index()
assert index == Index(
collection_w.collection, ct.default_float_vec_field_name, default_index_params)
assert collection_w.indexes[0] == index
assert index.params == {'index_type': 'AUTOINDEX', 'metric_type': 'COSINE', 'params': {},
'total_rows': ct.default_nb, 'indexed_rows': ct.default_nb, 'pending_index_rows': 0,
'state': 3}
# assert collection_w.indexes[0] == index

@pytest.mark.tags(CaseLabel.L2)
def test_insert_auto_id_true(self, pk_field):
Expand Down

0 comments on commit 9b4bd17

Please sign in to comment.