jason810496 commented on code in PR #49470:
URL: https://github.com/apache/airflow/pull/49470#discussion_r2111016615


##########
providers/elasticsearch/src/airflow/providers/elasticsearch/version_compat.py:
##########
@@ -33,3 +40,21 @@ def get_base_airflow_version_tuple() -> tuple[int, int, int]:
 
 
 AIRFLOW_V_3_0_PLUS = get_base_airflow_version_tuple() >= (3, 0, 0)
+AIRFLOW_V_3_0 = get_base_airflow_version_tuple() == (3, 0, 0)
+
+if AIRFLOW_V_3_0_PLUS and not AIRFLOW_V_3_0:
+    # greater than 3.0.0, compatibility with Airflow 3.0
+
+    def get_compatible_output_log_stream(
+        input_logs: list[StructuredLogMessage],
+    ) -> Generator[StructuredLogMessage, None, None]:
+        """
+        Convert a list of structured log messages into a generator.
+
+        This helper ensures compatibility with `os_task_handler` and 
`es_task_handler`,
+        and is intended to be removed after the log handler refactor in 
providers.
+
+        :param input_logs: List of structured log messages.
+        :return: A generator yielding structured log messages.
+        """
+        yield from input_logs

Review Comment:
   Thanks @uranusjr for the suggestion, set the type annotation to `Iterable` 
is more clear.
   I just replace the util with `iter` and removed the buffer for log reader.



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