Task

class labelbox.schema.task.Task(client, field_values)[source]

Bases: DbObject

Represents a server-side process that might take a longer time to process. Allows the Task state to be updated and checked on the client side.

updated_at
Type:

datetime

created_at
Type:

datetime

name
Type:

str

status
Type:

str

completion_percentage
Type:

float

created_by

ToOne relationship to User

Type:

Relationship

organization

ToOne relationship to Organization

Type:

Relationship

property created_data_rows: Dict[str, Any] | None

Fetch data rows which successfully created for an import task.

property errors: Dict[str, Any] | None

Fetch the error associated with an import task.

property failed_data_rows: Dict[str, Any] | None

Fetch data rows which failed to be created for an import task.

refresh() None[source]

Refreshes Task data from the server.

property result: List[Dict[str, Any]] | Dict[str, Any]

Fetch the result for an import task.

wait_till_done(timeout_seconds: float = 300.0, check_frequency: float = 2.0) None[source]

Waits until the task is completed. Periodically queries the server to update the task attributes.

Parameters:
  • timeout_seconds (float) – Maximum time this method can block, in seconds. Defaults to five minutes.

  • check_frequency (float) – Frequency of queries to server to update the task attributes, in seconds. Defaults to two seconds. Minimal value is two seconds.