ferruzzi commented on code in PR #63491:
URL: https://github.com/apache/airflow/pull/63491#discussion_r2961933602
##########
airflow-core/src/airflow/executors/workloads/base.py:
##########
@@ -20,12 +20,30 @@
import os
from abc import ABC
+from enum import Enum
from typing import TYPE_CHECKING
from pydantic import BaseModel, ConfigDict, Field
if TYPE_CHECKING:
from airflow.api_fastapi.auth.tokens import JWTGenerator
+ from airflow.executors.workloads.types import WorkloadKey
+
+
+class WorkloadType(str, Enum):
+ """Central registry of executor workload types."""
+
+ EXECUTE_TASK = "ExecuteTask"
+ EXECUTE_CALLBACK = "ExecuteCallback"
+
+
+# Central executor priority registry: Tuple is ordered from highest priority
to lowest.
+_workload_type_priority_order = (
+ WorkloadType.EXECUTE_CALLBACK,
+ WorkloadType.EXECUTE_TASK,
+)
+
+WORKLOAD_TYPE_TIER: dict[str, int] = {name: idx for idx, name in
enumerate(_workload_type_priority_order)}
Review Comment:
Two hard things. I can get behind any of those; maybe "priority" slightly
more.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]