Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
22d56849
M
milvus
项目概览
milvus
/
milvus
大约 1 年 前同步成功
通知
261
Star
22476
Fork
2472
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
milvus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
22d56849
编写于
7月 24, 2023
作者:
N
nico
提交者:
GitHub
7月 24, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update output binary vector field cases (#25819)
Signed-off-by:
N
nico
<
cheng.yuan@zilliz.com
>
上级
8542b266
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
10 addition
and
11 deletion
+10
-11
tests/python_client/requirements.txt
tests/python_client/requirements.txt
+1
-1
tests/python_client/testcases/test_collection.py
tests/python_client/testcases/test_collection.py
+1
-1
tests/python_client/testcases/test_search.py
tests/python_client/testcases/test_search.py
+8
-9
未找到文件。
tests/python_client/requirements.txt
浏览文件 @
22d56849
...
@@ -12,7 +12,7 @@ allure-pytest==2.7.0
...
@@ -12,7 +12,7 @@ allure-pytest==2.7.0
pytest-print==0.2.1
pytest-print==0.2.1
pytest-level==0.1.1
pytest-level==0.1.1
pytest-xdist==2.5.0
pytest-xdist==2.5.0
pymilvus==2.2.14.dev1
5
pymilvus==2.2.14.dev1
6
pytest-rerunfailures==9.1.1
pytest-rerunfailures==9.1.1
git+https://github.com/Projectplace/pytest-tags
git+https://github.com/Projectplace/pytest-tags
ndg-httpsclient
ndg-httpsclient
...
...
tests/python_client/testcases/test_collection.py
浏览文件 @
22d56849
...
@@ -1207,7 +1207,7 @@ class TestCollectionDataframe(TestcaseBase):
...
@@ -1207,7 +1207,7 @@ class TestCollectionDataframe(TestcaseBase):
"""
"""
self
.
_connect
()
self
.
_connect
()
c_name
=
cf
.
gen_unique_str
(
prefix
)
c_name
=
cf
.
gen_unique_str
(
prefix
)
error
=
{
ct
.
err_code
:
0
,
ct
.
err_msg
:
"Dataframe can not be None."
}
error
=
{
ct
.
err_code
:
1
,
ct
.
err_msg
:
"Dataframe can not be None."
}
self
.
collection_wrap
.
construct_from_dataframe
(
c_name
,
None
,
check_task
=
CheckTasks
.
err_res
,
check_items
=
error
)
self
.
collection_wrap
.
construct_from_dataframe
(
c_name
,
None
,
check_task
=
CheckTasks
.
err_res
,
check_items
=
error
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
...
...
tests/python_client/testcases/test_search.py
浏览文件 @
22d56849
...
@@ -1076,8 +1076,8 @@ class TestCollectionSearch(TestcaseBase):
...
@@ -1076,8 +1076,8 @@ class TestCollectionSearch(TestcaseBase):
expected: search successfully
expected: search successfully
"""
"""
# 1. initialize with data
# 1. initialize with data
collection_w
,
_
,
_
,
insert_ids
=
\
collection_w
=
\
self
.
init_collection_general
(
prefix
,
is_index
=
False
,
primary_field
=
default_string_field_name
)[
0
:
4
]
self
.
init_collection_general
(
prefix
,
is_index
=
False
,
primary_field
=
default_string_field_name
)[
0
]
nb
=
500
nb
=
500
data
=
cf
.
gen_default_list_data
(
nb
)
data
=
cf
.
gen_default_list_data
(
nb
)
for
_
in
range
(
10
):
for
_
in
range
(
10
):
...
@@ -1094,7 +1094,6 @@ class TestCollectionSearch(TestcaseBase):
...
@@ -1094,7 +1094,6 @@ class TestCollectionSearch(TestcaseBase):
search_params
,
default_limit
,
search_params
,
default_limit
,
check_task
=
CheckTasks
.
check_search_results
,
check_task
=
CheckTasks
.
check_search_results
,
check_items
=
{
"nq"
:
default_nq
,
check_items
=
{
"nq"
:
default_nq
,
"ids"
:
insert_ids
,
"limit"
:
default_limit
})
"limit"
:
default_limit
})
@
pytest
.
mark
.
tags
(
CaseLabel
.
L0
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L0
)
...
@@ -2792,8 +2791,7 @@ class TestCollectionSearch(TestcaseBase):
...
@@ -2792,8 +2791,7 @@ class TestCollectionSearch(TestcaseBase):
"output_fields"
:
[
field_name
]})
"output_fields"
:
[
field_name
]})
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
@
pytest
.
mark
.
skip
(
reason
=
"issue #23661"
)
@
pytest
.
mark
.
parametrize
(
"index"
,
[
"BIN_FLAT"
,
"BIN_IVF_FLAT"
])
@
pytest
.
mark
.
parametrize
(
"index"
,
ct
.
all_index_types
[
6
:
8
])
def
test_search_output_field_vector_after_binary_index
(
self
,
index
):
def
test_search_output_field_vector_after_binary_index
(
self
,
index
):
"""
"""
target: test search with output vector field after binary index
target: test search with output vector field after binary index
...
@@ -2809,19 +2807,19 @@ class TestCollectionSearch(TestcaseBase):
...
@@ -2809,19 +2807,19 @@ class TestCollectionSearch(TestcaseBase):
collection_w
.
insert
(
data
)
collection_w
.
insert
(
data
)
# 2. create index and load
# 2. create index and load
default_index
=
{
"index_type"
:
index
,
"
params"
:
{
"nlist"
:
128
},
"metric_type"
:
"JACCARD"
}
default_index
=
{
"index_type"
:
index
,
"
metric_type"
:
"JACCARD"
,
"params"
:
{
"nlist"
:
128
}
}
collection_w
.
create_index
(
binary_field_name
,
default_index
)
collection_w
.
create_index
(
binary_field_name
,
default_index
)
collection_w
.
load
()
collection_w
.
load
()
# 3. search with output field vector
# 3. search with output field vector
search_params
=
{
"metric_type"
:
"JACCARD"
,
"params"
:
{
"nprobe"
:
10
}
}
search_params
=
{
"metric_type"
:
"JACCARD"
}
binary_vectors
=
cf
.
gen_binary_vectors
(
1
,
default_dim
)[
1
]
binary_vectors
=
cf
.
gen_binary_vectors
(
1
,
default_dim
)[
1
]
res
=
collection_w
.
search
(
binary_vectors
,
binary_field_name
,
res
=
collection_w
.
search
(
binary_vectors
,
binary_field_name
,
ct
.
default_search_binary
_params
,
2
,
default_search_exp
,
search
_params
,
2
,
default_search_exp
,
output_fields
=
[
binary_field_name
])[
0
]
output_fields
=
[
binary_field_name
])[
0
]
# 4. check the result vectors should be equal to the inserted
# 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
.
tags
(
CaseLabel
.
L2
)
@
pytest
.
mark
.
parametrize
(
"dim"
,
[
32
,
128
,
768
])
@
pytest
.
mark
.
parametrize
(
"dim"
,
[
32
,
128
,
768
])
...
@@ -2914,6 +2912,7 @@ class TestCollectionSearch(TestcaseBase):
...
@@ -2914,6 +2912,7 @@ class TestCollectionSearch(TestcaseBase):
"output_fields"
:
[
field_name
]})
"output_fields"
:
[
field_name
]})
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
@
pytest
.
mark
.
skip
(
"not supported now"
)
@
pytest
.
mark
.
parametrize
(
"wildcard_output_fields"
,
[[
"*"
],
[
"*"
,
default_int64_field_name
]])
@
pytest
.
mark
.
parametrize
(
"wildcard_output_fields"
,
[[
"*"
],
[
"*"
,
default_int64_field_name
]])
def
test_search_with_output_field_wildcard
(
self
,
wildcard_output_fields
,
auto_id
,
_async
,
enable_dynamic_field
):
def
test_search_with_output_field_wildcard
(
self
,
wildcard_output_fields
,
auto_id
,
_async
,
enable_dynamic_field
):
"""
"""
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录