NabiBukhsh-AI commented on code in PR #74561:
URL: https://github.com/apache/airflow/pull/74561#discussion_r4730692935
##########
providers/amazon/src/airflow/providers/amazon/aws/hooks/appflow.py:
##########
@@ -80,11 +80,21 @@ def run_flow(
return execution_id
- def _log_execution_description(self, flow_name: str, execution_id: str):
- response_desc =
self.conn.describe_flow_execution_records(flowName=flow_name)
- last_execs = {fe["executionId"]: fe for fe in
response_desc["flowExecutions"]}
- exec_details = last_execs[execution_id]
- self.log.info("Run complete, execution details: %s", exec_details)
+ def _log_execution_description(self, flow_name: str, execution_id: str) ->
None:
Review Comment:
Thanks, you're right. The run_complete waiter only succeeds once it sees the
execution in the single page it requests, and the lookup sent that same
request, so the nextToken loop could never find a record the waiter hadn't
already seen. That matches your test, where an execution that isn't on the
first page makes the waiter time out first.
I've removed the loop and its repeated-token guard. The lookup now sends
exactly the waiter's request (maxResults=100) and logs a warning instead of
raising KeyError if the record is missing, which is what #72769 reported. I
also added a test that runs the real waiter against faked responses and checks
that both send the same request. Making the wait itself paginate would mean
replacing the botocore waiter with a custom polling loop, so I've kept that out
of this PR.
--
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]