You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/12/18 18:18:22 UTC
[GitHub] [airflow] BasPH commented on a change in pull request #20381: Fix kubernetes type hints
BasPH commented on a change in pull request #20381:
URL: https://github.com/apache/airflow/pull/20381#discussion_r771851421
##########
File path: airflow/providers/cncf/kubernetes/utils/pod_launcher.py
##########
@@ -321,19 +322,24 @@ def _exec_pod_command(self, resp, command: str) -> None:
break
return None
- def process_status(self, job_id: str, status: str) -> str:
- """Process status information for the JOB"""
- status = status.lower()
- if status == PodStatus.PENDING:
+ def process_status(self, pod_name: str, pod_phase: str) -> TaskInstanceState:
+ """
+ Convert a K8S Pod phase to Airflow task state.
+ :param pod_name: Name of the pod
+ :param pod_phase: Phase of the pod
+ :return: Airflow task state corresponding to the pod phase
+ """
+ pod_phase = pod_phase.lower()
+ if pod_phase == PodStatus.PENDING:
return State.QUEUED
Review comment:
Ah much better! I couldn't think of a good reason for the state conversion anyways👍
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org