potiuk commented on a change in pull request #20654:
URL: https://github.com/apache/airflow/pull/20654#discussion_r780238975



##########
File path: airflow/providers/cncf/kubernetes/utils/pod_manager.py
##########
@@ -180,7 +180,7 @@ def follow_container_logs(self, pod: V1Pod, container_name: 
str) -> None:
             So the looping logic is there to let us resume following the logs.
         """
 
-        def follow_logs(since_time: Optional[datetime] = None) -> 
Optional[datetime]:
+        def follow_logs(since_time: Optional[datetime] = None) -> Union[Date, 
Time, Duration, datetime, None]:

Review comment:
       That's hell of a union :)

##########
File path: airflow/providers/cncf/kubernetes/utils/pod_manager.py
##########
@@ -180,7 +180,7 @@ def follow_container_logs(self, pod: V1Pod, container_name: 
str) -> None:
             So the looping logic is there to let us resume following the logs.
         """
 
-        def follow_logs(since_time: Optional[datetime] = None) -> 
Optional[datetime]:
+        def follow_logs(since_time: Optional[datetime] = None) -> Union[Date, 
Time, Duration, datetime, None]:

Review comment:
       The result does not seem to be used (last_log_time = follow_logs() is 
not used). Seems to be a remnant of previous version of log following. Can we 
just make the function -> None and do not return anything from it ?

##########
File path: airflow/providers/cncf/kubernetes/utils/pod_manager.py
##########
@@ -180,7 +180,7 @@ def follow_container_logs(self, pod: V1Pod, container_name: 
str) -> None:
             So the looping logic is there to let us resume following the logs.
         """
 
-        def follow_logs(since_time: Optional[datetime] = None) -> 
Optional[datetime]:
+        def follow_logs(since_time: Optional[datetime] = None) -> Union[Date, 
Time, Duration, datetime, None]:

Review comment:
       ~The result does not seem to be used (last_log_time = follow_logs() is 
not used). Seems to be a remnant of previous version of log following. Can we 
just make the function -> None and do not return anything from it ?~

##########
File path: airflow/providers/cncf/kubernetes/utils/pod_manager.py
##########
@@ -180,7 +180,7 @@ def follow_container_logs(self, pod: V1Pod, container_name: 
str) -> None:
             So the looping logic is there to let us resume following the logs.
         """
 
-        def follow_logs(since_time: Optional[datetime] = None) -> 
Optional[datetime]:
+        def follow_logs(since_time: Optional[datetime] = None) -> Union[Date, 
Time, Duration, datetime, None]:

Review comment:
       Scratch that - it is used. but still it seems rather strange as it is 
only used in calling the follow_logs(since_time=last_log_time) and it's 
Optional[datetime] there. This Union does not look right.




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