anishgirianish commented on code in PR #63491:
URL: https://github.com/apache/airflow/pull/63491#discussion_r3179110402


##########
airflow-core/src/airflow/executors/workloads/base.py:
##########
@@ -30,6 +31,22 @@
     from airflow.executors.workloads.types import WorkloadState
 
 
+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_PRIORITY: dict[str, int] = {name: idx for idx, name in 
enumerate(_workload_type_priority_order)}

Review Comment:
   Done added the three-place docstring; combined with the .get() fallback 
below, an out-of-sync subclass sorts last instead of crashing. thank you



-- 
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]

Reply via email to