Skip to main content

TaskSet

This class represents the result metadata for a set of tasks, mapping to the underlying database storage for Celery task sets. It provides a structure for tracking unique task set identifiers, their pickled results, and completion timestamps. The class includes utility methods for dictionary conversion and schema configuration for database integration.

Attributes

AttributeTypeDescription
idintegerUnique internal primary key for the taskset record, automatically incremented using a sequence.
taskset_idstringUnique identifier string for the specific taskset, limited to 155 characters.
resultPickleTypeThe pickled result data associated with the taskset, which can be null if no result is available.
date_donedatetime = _get_utc_nowThe UTC timestamp indicating when the taskset execution was completed.

Constructor

Signature

def TaskSet(
taskset_id: string,
result: any
) - > null

Parameters

NameTypeDescription
taskset_idstringThe unique identifier for the task set.
resultanyThe result data associated with the task set, typically stored as a pickled object.

Signature

def TaskSet(
taskset_id: string,
result: any
)

Parameters

NameTypeDescription
taskset_idstringThe unique identifier for the task set group.
resultanyThe pickled result data or metadata associated with the task set.

Methods


to_dict()

@classmethod
def to_dict() - > dict

Converts the TaskSet model instance into a dictionary representation for serialization.

Returns

TypeDescription
dictA dictionary containing the taskset_id, result, and date_done timestamp.

configure()

@classmethod
def configure(
schema: string = null,
name: string = null
)

Configures the database schema and table name for the TaskSet model at runtime.

Parameters

NameTypeDescription
schemastring = nullThe database schema name to apply to the table and its sequences.
namestring = nullAn optional override for the database table name; defaults to the class tablename if not provided.