milvus-logo
LFAI
< Docs

get_bulk_insert_state()

This method returns the state of the bulk insert task by a given task ID.

Invocation

get_bulk_insert_state(task_id, timeout=None, using="default", **kwargs)

Parameters

ParameterDescriptionTypeRequired
task_idID of a running bulk insert taskIntegerTrue
timetoutAn 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.IntegerFalse
usingAlias of the Milvus connection to be attached toStringFalse

Returns

Returns a BulkInsertState object.

Example

from pymilvus import connections, utility, BulkInsertState
connections.connect()
state = utility.get_bulk_insert_state(task_id=id) # the id is returned by do_bulk_insert()
if state.state == BulkInsertState.ImportFailed or state.state == BulkInsertState.ImportFailedAndCleaned:
   print("task id:", state.task_id, "failed, reason:", state.failed_reason)