uranusjr commented on code in PR #59097:
URL: https://github.com/apache/airflow/pull/59097#discussion_r2674306609


##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/operators/pod.py:
##########
@@ -1390,6 +1390,17 @@ def _get_most_recent_pod_index(pod_list: 
list[k8s.V1Pod]) -> int:
         pod_start_times: list[datetime.datetime] = [
             pod.to_dict().get("status").get("start_time") for pod in pod_list
         ]
+        if not all(pod_start_times):
+            pod_start_times: list[datetime.datetime] = [  # type: 
ignore[no-redef]
+                pod_start_time
+                if (
+                    pod_start_time := pod.to_dict()
+                    .get("metadata", {})
+                    .get("creation_timestamp", 
datetime.datetime.now(tz=datetime.timezone.utc))
+                )
+                else datetime.datetime.now(tz=datetime.timezone.utc)

Review Comment:
   Do you mean the value to `"create_timestamp"` could contain None? That does 
not feel right to me.



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