Skip to main content

MapAnnotation

Annotation map: task_name = > attributes.

Attributes​

AttributeTypeDescription
task_namedictA mapping of task names to their corresponding attribute dictionaries used for task-specific metadata.

Methods​


annotate_any()​

@classmethod
def annotate_any() - > dict

Retrieves the default annotation attributes applicable to any task.

Returns​

TypeDescription
dictA dictionary of attributes associated with the wildcard key, or None if no global annotations exist

annotate()​

@classmethod
def annotate(
task: [Task](../../events/state/task.md?sid=celery_events_state_task)
) - > dict

Fetches the specific annotation attributes associated with a given task's name.

Parameters​

NameTypeDescription
task[Task](../../events/state/task.md?sid=celery_events_state_task)The task object whose name is used as the lookup key in the annotation map

Returns​

TypeDescription
dictA dictionary of attributes mapped to the task name, or None if the task is not explicitly annotated