milvus-logo
LFAI
< Docs
  • Python

Partition()

This is the constructor method to create a partition in the specified collection.

Invocation

Partition(collection, name, description='', **kwargs)

Parameters

ParameterDescriptionTypeRequired
collectionA collection objectCollectionTrue
nameName of the partition to createStringTrue
descriptionDescription of the collectionStringFalse

Return

A new partition object created with the specified name.

Properties

PropertyDescriptionType
nameName of the partitionString
descriptionDescription of the collectionString
is_emptyBoolean value to indicate if the partition is emptyBool
num_entitiesNumber of entities in the partitionInteger

Example

from pymilvus import Collection, Partition
collection = Collection("book")
partition = Partition(collection, "novel", "")
Feedback

Was this page helpful?