Taragolis commented on code in PR #36281:
URL: https://github.com/apache/airflow/pull/36281#discussion_r1436021229


##########
airflow/providers/cncf/kubernetes/pod_launcher_deprecated.py:
##########
@@ -148,13 +148,13 @@ def monitor_pod(self, pod: V1Pod, get_logs: bool) -> 
tuple[State, str | None]:
         """
         if get_logs:
             read_logs_since_sec = None
-            last_log_time = None
+            last_log_time: pendulum.DateTime | None = None
             while True:
                 logs = self.read_pod_logs(pod, timestamps=True, 
since_seconds=read_logs_since_sec)
                 for line in logs:
                     timestamp, message = 
self.parse_log_line(line.decode("utf-8"))
                     if timestamp:
-                        last_log_time = pendulum.parse(timestamp)
+                        last_log_time = cast(pendulum.DateTime, 
pendulum.parse(timestamp))

Review Comment:
   In addition 
`airflow.providers.cncf.kubernetes.utils.pod_launcher_deprecated`  is 
deprecated and replaced by `airflow.providers.cncf.kubernetes.utils.pod_manager`
   
   However the implementation in this case almost the same with the same 
potential problem, I'm not sure is it possible to get something rather than 
DateTime but might be better check instance of class and replace it by None if 
it invalid type
   
   
https://github.com/apache/airflow/blob/3e7f50ece336f4fe09f13d95fd1115394be6f314/airflow/providers/cncf/kubernetes/utils/pod_manager.py#L607-L611



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