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


##########
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:
   Ah OK that makes sense; I hate this kind of multi purpose functions. I’d 
prefer something like `assert isinstance(last_log_time, pendulum.DateTime)` 
(less runtime overhead) but this is fine.



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