Lee-W commented on code in PR #46827:
URL: https://github.com/apache/airflow/pull/46827#discussion_r1969553500
##########
providers/elasticsearch/src/airflow/providers/elasticsearch/log/es_task_handler.py:
##########
@@ -358,12 +371,31 @@ def _read(
# If we hit the end of the log, remove the actual end_of_log message
# to prevent it from showing in the UI.
- def concat_logs(hits: list[Hit]):
+ def concat_logs(hits: list[Hit]) -> str:
log_range = (len(hits) - 1) if hits[-1].message ==
self.end_of_log_mark else len(hits)
return "\n".join(self._format_msg(hits[i]) for i in
range(log_range))
if logs_by_host:
- message = [(host, concat_logs(hits)) for host, hits in
logs_by_host.items()]
+ if AIRFLOW_V_3_0_PLUS:
+ from airflow.utils.log.file_task_handler import
StructuredLogMessage
+
+ header = [
+ StructuredLogMessage.model_construct(
Review Comment:
@pierrejeambrun would like to confirm whether we want to make this change.
Either way works for me. I can make this change later 🙂
--
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]