ashb commented on code in PR #46827:
URL: https://github.com/apache/airflow/pull/46827#discussion_r1969538255


##########
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:
   Likely not required, I was just thinking "why bother running validation if 
we know we don't need to". Happy to change it either way



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