NabiBukhsh-AI opened a new pull request, #74561:
URL: https://github.com/apache/airflow/pull/74561

   ### Description
   
   In `AppflowHook._log_execution_description`, the hook previously queried 
`DescribeFlowExecutionRecords` once without specifying `maxResults` (defaulting 
to 20) and without handling `nextToken`.
   
   Because AppFlow returns execution records in batches, a recently completed 
flow execution might not be included in the first page of 20 results. In such 
cases, attempting to look up `last_execs[execution_id]` resulted in an 
unhandled `KeyError`, crashing an otherwise successful flow execution.
   
   This change:
   1. Paginates through `DescribeFlowExecutionRecords` with `maxResults=100` 
until the target `execution_id` is found.
   2. If the execution record is not found after inspecting all pages, logs a 
warning instead of raising `KeyError`, preventing a logging helper from failing 
the entire task.
   3. Sets `maxResults=100` in the waiter arguments inside `run_flow` to 
examine up to 100 records per attempt instead of 20.
   4. Adds unit tests covering single-page retrieval, multi-page pagination 
with `nextToken`, and graceful warning handling when an execution is missing.
   
   closes: #72769
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes (Antigravity)
   
   <!--
   Generated-by: Antigravity following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   -->


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