test: add struct array testcases (#44940)

/kind improvement

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
This commit is contained in:
zhuwenxing 2025-10-20 17:34:03 +08:00 committed by GitHub
parent a4935d2eaa
commit 2f4b66d9ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3299 additions and 4 deletions

View File

@ -2,7 +2,6 @@ import pytest
import numpy import numpy
from base.client_v2_base import TestMilvusClientV2Base from base.client_v2_base import TestMilvusClientV2Base
from utils.util_log import test_log as log
from common import common_func as cf from common import common_func as cf
from common import common_type as ct from common import common_type as ct
from common.common_type import CaseLabel, CheckTasks from common.common_type import CaseLabel, CheckTasks
@ -4530,6 +4529,15 @@ class TestMilvusClientCollectionMultipleVectorValid(TestMilvusClientV2Base):
and v != DataType.INT8_VECTOR and v != DataType.SPARSE_FLOAT_VECTOR): and v != DataType.INT8_VECTOR and v != DataType.SPARSE_FLOAT_VECTOR):
supported_types.append((k.lower(), v)) supported_types.append((k.lower(), v))
for field_name, data_type in supported_types: for field_name, data_type in supported_types:
if field_name.lower().startswith("_"):
# skip private fields
continue
if data_type == DataType.STRUCT:
# add struct field
struct_schema = client.create_struct_field_schema()
struct_schema.add_field("struct_scalar_field", DataType.INT64)
schema.add_field(field_name, DataType.ARRAY, element_type=DataType.STRUCT, struct_schema=struct_schema, max_capacity=10)
continue
# Skip INT64 and VARCHAR as they're already added as primary key # Skip INT64 and VARCHAR as they're already added as primary key
if data_type != DataType.INT64 and data_type != DataType.VARCHAR: if data_type != DataType.INT64 and data_type != DataType.VARCHAR:
schema.add_field(field_name, data_type) schema.add_field(field_name, data_type)

File diff suppressed because it is too large Load Diff

View File

@ -28,9 +28,8 @@ pytest-parallel
pytest-random-order pytest-random-order
# pymilvus # pymilvus
pymilvus==2.7.0rc44 pymilvus==2.7.0rc46
pymilvus[bulk_writer]==2.7.0rc44 pymilvus[bulk_writer]==2.7.0rc46
# for protobuf # for protobuf
protobuf>=5.29.5 protobuf>=5.29.5