Programmer-RD-AI opened a new pull request, #52674:
URL: https://github.com/apache/airflow/pull/52674

   **Closes:** #52666
   
   This pull request enhances the Airflow documentation around fetching and 
using the `triggering_asset_events` context variable in DAGs. It provides 
clearer guidance and real‐world examples to improve authoring and scheduling 
workflows.
   
   ### What’s Changed
   
   * **Jinja Templating Examples**
   
     * Added a “Single Triggering Asset” snippet demonstrating how to access 
the first `AssetEvent` via `{{ triggering_asset_events.values() | first | first 
}}`.
     * Provided a “Multiple Triggering Assets” loop example to iterate over all 
assets and their events in BashOperator templates.
   
   * **Python Task Examples**
   
     * Included a Python `@task` function showing direct access to 
`triggering_asset_events` as a parameter, with illustrative prints for 
`event.source_dag_run.*` attributes.
   
   * **Structural Clarifications**
   
     * Explained that `triggering_asset_events` is a `dict[AssetURI, 
list[AssetEvent]]` and outlined best practices for handling multiple events per 
asset.
   
   * **Edge-Case Note**
   
     * Added a warning about complexity when a DAG is scheduled by multiple 
assets or when assets are updated multiple times before consumption, suggesting 
strategies for bespoke processing logic.
   
   ### Why This Matters
   
   Clear, example-driven documentation reduces onboarding friction for users 
authoring asset-driven DAGs and prevents misinterpretation of the 
`triggering_asset_events` API surface.


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