schattian commented on code in PR #23658:
URL: https://github.com/apache/airflow/pull/23658#discussion_r890885849
##########
airflow/providers/cncf/kubernetes/utils/pod_manager.py:
##########
@@ -193,6 +195,40 @@ def follow_container_logs(self, pod: V1Pod,
container_name: str) -> PodLoggingSt
)
return self.fetch_container_logs(pod=pod,
container_name=container_name, follow=True)
+ def log_iterable(self, logs: Iterable[bytes]) -> Optional[DateTime]:
+ timestamp = None
+ for line in logs:
+ timestamp, message = self.parse_log_line(line.decode('utf-8',
errors="backslashreplace"))
+ self.log.info(message)
+ return timestamp
+
+ def consume_container_logs_stream(
+ self, pod: V1Pod, container_name: str, stream: Iterable[bytes]
+ ) -> Optional[DateTime]:
+ def log_iterable_and_set_value(timestamp):
+ dt = self.log_iterable(stream)
+ if dt is not None:
+ timestamp.value = dt.timestamp() # type: ignore[attr-defined]
Review Comment:
i cannot do it with dt as i am using a rawvalue('f') -float-. Therefore, i
need to use the unix ts instead to pass it.
--
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]