def gen_default_binary_collection_schema( description=ct.default_desc, primary_field=ct.default_int64_field_name): fields = [gen_int64_field(), gen_float_field(), gen_binary_vec_field()] binary_schema, _ = ApiCollectionSchemaWrapper().init_collection_schema( fields=fields, description=description, primary_field=primary_field) return binary_schema
def gen_general_collection_schema(description=ct.default_desc, primary_field=ct.default_int64_field_name, auto_id=False, is_binary=False, dim=ct.default_dim): if is_binary: fields = [ gen_int64_field(), gen_float_field(), gen_string_field(), gen_binary_vec_field(dim=dim) ] else: fields = [ gen_int64_field(), gen_float_field(), gen_string_field(), gen_float_vec_field(dim=dim) ] schema, _ = ApiCollectionSchemaWrapper().init_collection_schema( fields=fields, description=description, primary_field=primary_field, auto_id=auto_id) return schema
def gen_schema_multi_vector_fields(vec_fields): fields = [gen_int64_field(), gen_float_field(), gen_float_vec_field()] fields.extend(vec_fields) primary_field = ct.default_int64_field_name schema, _ = ApiCollectionSchemaWrapper().init_collection_schema(fields=fields, description=ct.default_desc, primary_field=primary_field, auto_id=False) return schema
def gen_collection_schema_all_datatype(description=ct.default_desc, primary_field=ct.default_int64_field_name, auto_id=False): fields = [gen_int64_field(), gen_int32_field(), gen_int16_field(), gen_int8_field(), gen_bool_field(), gen_float_field(), gen_double_field(), gen_float_vec_field()] schema, _ = ApiCollectionSchemaWrapper().init_collection_schema(fields=fields, description=description, primary_field=primary_field, auto_id=auto_id) return schema
def setup(self): log.info(("*" * 35) + " setup " + ("*" * 35)) self.connection_wrap = ApiConnectionsWrapper() self.collection_wrap = ApiCollectionWrapper() self.partition_wrap = ApiPartitionWrapper() self.index_wrap = ApiIndexWrapper() self.utility_wrap = ApiUtilityWrapper() self.collection_schema_wrap = ApiCollectionSchemaWrapper() self.field_schema_wrap = ApiFieldSchemaWrapper()
def gen_collection_schema(fields, primary_field=None, description=ct.default_desc, auto_id=False): schema, _ = ApiCollectionSchemaWrapper().init_collection_schema( fields=fields, primary_field=primary_field, description=description, auto_id=auto_id) return schema
def setup_method(self, method): log.info(("*" * 35) + " setup " + ("*" * 35)) log.info("[setup_method] Start setup test case %s." % method.__name__) self.connection_wrap = ApiConnectionsWrapper() self.utility_wrap = ApiUtilityWrapper() self.collection_wrap = ApiCollectionWrapper() self.partition_wrap = ApiPartitionWrapper() self.index_wrap = ApiIndexWrapper() self.collection_schema_wrap = ApiCollectionSchemaWrapper() self.field_schema_wrap = ApiFieldSchemaWrapper()