Skip to content

Commit

Permalink
enhance: allow hyphen in partition name (#38461)
Browse files Browse the repository at this point in the history
Signed-off-by: sunby <[email protected]>
  • Loading branch information
sunby authored Dec 16, 2024
1 parent 058c2ab commit ac3dcb6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion internal/proxy/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ func validatePartitionTag(partitionTag string, strictCheck bool) error {
tagSize := len(partitionTag)
for i := 1; i < tagSize; i++ {
c := partitionTag[i]
if c != '_' && !isAlpha(c) && !isNumber(c) {
if c != '_' && !isAlpha(c) && !isNumber(c) && c != '-' {
msg := invalidMsg + "Partition name can only contain numbers, letters and underscores."
return errors.New(msg)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def test_milvus_client_insert_not_matched_data(self):
check_task=CheckTasks.err_res, check_items=error)

@pytest.mark.tags(CaseLabel.L1)
@pytest.mark.parametrize("partition_name", ["12-s", "12 s", "(mn)", "中文", "%$#", " "])
@pytest.mark.parametrize("partition_name", ["12 s", "(mn)", "中文", "%$#", " "])
def test_milvus_client_insert_invalid_partition_name(self, partition_name):
"""
target: test milvus client: insert extra field than schema
Expand Down Expand Up @@ -749,7 +749,7 @@ def test_milvus_client_upsert_not_matched_data(self):
check_task=CheckTasks.err_res, check_items=error)

@pytest.mark.tags(CaseLabel.L1)
@pytest.mark.parametrize("partition_name", ["12-s", "12 s", "(mn)", "中文", "%$#", " "])
@pytest.mark.parametrize("partition_name", ["12 s", "(mn)", "中文", "%$#", " "])
def test_milvus_client_upsert_invalid_partition_name(self, partition_name):
"""
target: test milvus client: insert extra field than schema
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def test_milvus_client_partition_not_exist_collection_name(self):
check_task=CheckTasks.err_res, check_items=error)

@pytest.mark.tags(CaseLabel.L1)
@pytest.mark.parametrize("partition_name", ["12-s", "12 s", "(mn)", "中文", "%$#"])
@pytest.mark.parametrize("partition_name", ["12 s", "(mn)", "中文", "%$#"])
def test_milvus_client_partition_invalid_partition_name(self, partition_name):
"""
target: test fast create collection normal case
Expand Down Expand Up @@ -385,7 +385,7 @@ def test_milvus_client_drop_partition_not_exist_collection_name(self):
check_task=CheckTasks.err_res, check_items=error)

@pytest.mark.tags(CaseLabel.L1)
@pytest.mark.parametrize("partition_name", ["12-s", "12 s", "(mn)", "中文", "%$#"])
@pytest.mark.parametrize("partition_name", ["12 s", "(mn)", "中文", "%$#"])
def test_milvus_client_drop_partition_invalid_partition_name(self, partition_name):
"""
target: test fast create collection normal case
Expand Down Expand Up @@ -485,7 +485,7 @@ def test_milvus_client_release_partition_not_exist_collection_name(self):

@pytest.mark.tags(CaseLabel.L1)
@pytest.mark.xfail(reason="pymilvus issue 1896")
@pytest.mark.parametrize("partition_name", ["12-s", "12 s", "(mn)", "中文", "%$#"])
@pytest.mark.parametrize("partition_name", ["12 s", "(mn)", "中文", "%$#"])
def test_milvus_client_release_partition_invalid_partition_name(self, partition_name):
"""
target: test release partition -- invalid partition name value
Expand Down Expand Up @@ -813,7 +813,7 @@ def test_milvus_client_has_partition_not_exist_collection_name(self):
check_task=CheckTasks.err_res, check_items=error)

@pytest.mark.tags(CaseLabel.L1)
@pytest.mark.parametrize("partition_name", ["12-s", "12 s", "(mn)", "中文", "%$#"])
@pytest.mark.parametrize("partition_name", ["12 s", "(mn)", "中文", "%$#"])
def test_milvus_client_has_partition_invalid_partition_name(self, partition_name):
"""
target: test fast create collection normal case
Expand Down Expand Up @@ -935,7 +935,7 @@ def test_milvus_client_load_partitions_collection_name_over_max_length(self):
check_task=CheckTasks.err_res, check_items=error)

@pytest.mark.tags(CaseLabel.L1)
@pytest.mark.parametrize("name", ["12-s", "12 s", "(mn)", "中文", "%$#"])
@pytest.mark.parametrize("name", ["12 s", "(mn)", "中文", "%$#"])
def test_milvus_client_load_partitions_invalid_partition_name(self, name):
"""
target: test fast create collection normal case
Expand Down

0 comments on commit ac3dcb6

Please sign in to comment.