milvus-logo
LFAI
< Docs
  • Python

has_partition()

This method verifies if a partition exists in the specified collection.

Invocation

has_partition(partition_name, timeout=None)

Parameters

ParameterDescriptionTypeRequired
partition_nameName of the partition to verifyStringTrue
timeoutAn optional duration of time in seconds to allow for the RPC. If it is set to None, the client keeps waiting until the server responds or error occurs.FloatFalse

Return

A boolean value that indicates if the partition exists.

Raises

  • CollectionNotExistException: error if the collection does not exist.
  • BaseException: error if the specified partition does not exist.

Example

from pymilvus import Collection
collection = Collection("book")      # Get an existing collection.
collection.has_partition("novel")

Try Managed Milvus for Free

Zilliz Cloud is hassle-free, powered by Milvus and 10x faster.

Get Started
Feedback

Was this page helpful?