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
| Attribute | Type | Description |
|---|---|---|
| id | integer | Unique internal primary key for the taskset record, automatically incremented using a sequence. |
| taskset_id | string | Unique identifier string for the specific taskset, limited to 155 characters. |
| result | PickleType | The pickled result data associated with the taskset, which can be null if no result is available. |
| date_done | datetime = _get_utc_now | The UTC timestamp indicating when the taskset execution was completed. |
Constructor
Signature
def TaskSet(
taskset_id: string,
result: any
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| taskset_id | string | The unique identifier for the task set. |
| result | any | The result data associated with the task set, typically stored as a pickled object. |
Signature
def TaskSet(
taskset_id: string,
result: any
)
Parameters
| Name | Type | Description |
|---|---|---|
| taskset_id | string | The unique identifier for the task set group. |
| result | any | The 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
| Type | Description |
|---|---|
dict | A 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
| Name | Type | Description |
|---|---|---|
| schema | string = null | The database schema name to apply to the table and its sequences. |
| name | string = null | An optional override for the database table name; defaults to the class tablename if not provided. |