You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "vandonr-amz (via GitHub)" <gi...@apache.org> on 2023/06/08 00:25:32 UTC

[GitHub] [airflow] vandonr-amz commented on a diff in pull request #31786: rewrite method used in ecs to fetch less logs

vandonr-amz commented on code in PR #31786:
URL: https://github.com/apache/airflow/pull/31786#discussion_r1222310055


##########
airflow/providers/amazon/aws/hooks/logs.py:
##########
@@ -103,7 +104,12 @@ def get_log_events(
                 skip -= event_count
                 events = []
 
-            yield from events
+            if not start_from_head:
+                # if we are not reading from head, it doesn't make sense to return events in "normal" order
+                # while hiding the subsequent calls, bc 1-9 queried by batches of 3 would return 789 456 123
+                yield from reversed(events)

Review Comment:
   this is a breaking change, but the method was never used with start_from_head=False so far, and if it was, the results would have been messed up as soon as there was enough logs to make it 2 queries, so I'm calling this a bugfix...



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org