hterik commented on code in PR #54858:
URL: https://github.com/apache/airflow/pull/54858#discussion_r2297171558


##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/executors/kubernetes_executor_types.py:
##########
@@ -35,27 +42,40 @@ class FailureDetails(TypedDict, total=False):
     container_name: str | None
 
 
-if TYPE_CHECKING:
-    from collections.abc import Sequence
+class KubernetesResults(NamedTuple):
+    """Results from Kubernetes task execution."""
 
-    from airflow.models.taskinstance import TaskInstanceKey
-    from airflow.utils.state import TaskInstanceState
+    key: TaskInstanceKey  # 使用字符串引用

Review Comment:
   Please stay with English.



##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/executors/kubernetes_executor.py:
##########
@@ -735,18 +738,26 @@ def _flush_result_queue(self) -> None:
                 results = self.result_queue.get_nowait()
                 self.log.warning("Executor shutting down, flushing 
results=%s", results)
                 try:
-                    key, state, pod_name, namespace, resource_version, 
failure_details = results
                     self.log.info(
-                        "Changing state of %s to %s : resource_version=%d", 
results, state, resource_version
+                        "Changing state of %s to %s : resource_version=%s",
+                        results,
+                        results.state,
+                        results.resource_version,
                     )
                     try:
-                        self._change_state(key, state, pod_name, namespace, 
failure_details)
+                        self._change_state(
+                            results.key,
+                            results.state,
+                            results.pod_name,
+                            results.namespace,
+                            results.failure_details,
+                        )

Review Comment:
   Would it make sense to change the signature of `_change_state` to accept 
only a single `result` argument?



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