MCPcopy Create free account
hub / github.com/alibaba/zvec / test_create_column

Method test_create_column

python/tests/test_collection.py:316–328  ·  view source on GitHub ↗
(self, test_collection: Collection)

Source from the content-addressed store, hash-verified

314@pytest.mark.usefixtures("test_collection")
315class TestCollectionColumnDDL:
316 def test_create_column(self, test_collection: Collection):
317 # before create column
318 field_schema = test_collection.schema.field("age")
319 assert field_schema is None
320
321 # create
322 test_collection.add_column(FieldSchema("age", DataType.INT32, nullable=True))
323
324 field_schema = test_collection.schema.field("age")
325 assert field_schema is not None
326 assert field_schema.data_type == DataType.INT32
327 assert field_schema.name == "age"
328 assert field_schema.index_param is None
329
330 def test_create_column_is_nullable(self, test_collection: Collection):
331 with pytest.raises(ValueError):

Callers

nothing calls this directly

Calls 3

FieldSchemaClass · 0.90
fieldMethod · 0.45
add_columnMethod · 0.45

Tested by

no test coverage detected