Lee-W commented on code in PR #46827:
URL: https://github.com/apache/airflow/pull/46827#discussion_r1967893170


##########
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:
   This basically follows 
https://github.com/apache/airflow/pull/46827/files#diff-e7f34f73940eb52d92bb991abedc1c963431c5373c12dff739c8fb7d03e93d3aR417.
 Would like to confirm with @ashb whether there's any reason we're doing it. it 
not we probably could go with `StructuredLogMessage(...)`?



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