Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
35bb577d
M
milvus
项目概览
milvus
/
milvus
11 个月 前同步成功
通知
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,发现更多精彩内容 >>
未验证
提交
35bb577d
编写于
5月 12, 2023
作者:
N
nico
提交者:
GitHub
5月 12, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Replace num_entities with count(*) in some test cases (#24033)
Signed-off-by:
N
nico
<
cheng.yuan@zilliz.com
>
上级
4c956fab
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
17 addition
and
7 deletion
+17
-7
tests/python_client/testcases/test_delete.py
tests/python_client/testcases/test_delete.py
+4
-2
tests/python_client/testcases/test_insert.py
tests/python_client/testcases/test_insert.py
+13
-5
未找到文件。
tests/python_client/testcases/test_delete.py
浏览文件 @
35bb577d
...
...
@@ -1250,8 +1250,8 @@ class TestDeleteString(TestcaseBase):
# delete half and flush
expr
=
f
'
{
ct
.
default_string_field_name
}
in
{
insert_res
.
primary_keys
[:
ct
.
default_nb
//
2
]
}
'
expr
=
expr
.
replace
(
"'"
,
"
\"
"
)
del_res
,
_
=
collection_w
.
delete
(
expr
)
assert
collection_w
.
num_entities
==
ct
.
default_nb
collection_w
.
delete
(
expr
)
collection_w
.
flush
()
# create index
index_params
=
{
"index_type"
:
"IVF_SQ8"
,
...
...
@@ -1260,6 +1260,8 @@ class TestDeleteString(TestcaseBase):
assert
collection_w
.
has_index
()[
0
]
collection_w
.
load
()
res
=
collection_w
.
query
(
expr
=
""
,
output_fields
=
[
"count(*)"
])[
0
]
assert
res
[
0
][
"count(*)"
]
==
ct
.
default_nb
//
2
search_res
,
_
=
collection_w
.
search
([
df
[
ct
.
default_float_vec_field_name
][
0
]],
ct
.
default_float_vec_field_name
,
ct
.
default_search_params
,
ct
.
default_limit
)
...
...
tests/python_client/testcases/test_insert.py
浏览文件 @
35bb577d
...
...
@@ -1535,10 +1535,13 @@ class TestUpsertValid(TestcaseBase):
upsert_nb
=
1000
collection_w
=
self
.
init_collection_general
(
pre_upsert
,
True
)[
0
]
# upsert
step
=
500
for
i
in
range
(
10
):
data
=
cf
.
gen_default_data_for_upsert
(
upsert_nb
,
start
=
i
*
500
)[
0
]
data
=
cf
.
gen_default_data_for_upsert
(
upsert_nb
,
start
=
i
*
step
)[
0
]
collection_w
.
upsert
(
data
)
assert
collection_w
.
num_entities
==
upsert_nb
*
10
+
ct
.
default_nb
# check the result
res
=
collection_w
.
query
(
expr
=
""
,
output_fields
=
[
"count(*)"
])[
0
]
assert
res
[
0
][
"count(*)"
]
==
upsert_nb
*
10
-
step
*
9
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
def
test_upsert_pk_string_multiple_times
(
self
):
...
...
@@ -1554,12 +1557,17 @@ class TestUpsertValid(TestcaseBase):
name
=
cf
.
gen_unique_str
(
pre_upsert
)
collection_w
=
self
.
init_collection_wrap
(
name
,
schema
)
collection_w
.
insert
(
cf
.
gen_default_list_data
())
# upsert
step
=
500
for
i
in
range
(
10
):
data
=
cf
.
gen_default_list_data
(
upsert_nb
,
start
=
i
*
500
)
data
=
cf
.
gen_default_list_data
(
upsert_nb
,
start
=
i
*
step
)
collection_w
.
upsert
(
data
)
assert
collection_w
.
num_entities
==
upsert_nb
*
10
+
ct
.
default_nb
# load
collection_w
.
create_index
(
ct
.
default_float_vec_field_name
,
default_index_params
)
collection_w
.
load
()
# check the result
res
=
collection_w
.
query
(
expr
=
""
,
output_fields
=
[
"count(*)"
])[
0
]
assert
res
[
0
][
"count(*)"
]
==
upsert_nb
*
10
-
step
*
9
class
TestUpsertInvalid
(
TestcaseBase
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录