Add from_trigger field to AssetEvent extra for events from Trigger #44944
Labels
area:API
Airflow's REST/HTTP API
area:UI
Related to UI/UX. For Frontend Developers.
kind:feature
Feature Requests
needs-triage
label for new issues that we didn't triage yet
Description
Currently when API is used to create an asset event
from_rest_api
is set asTrue
inextra
for theAssetEvent
. This helps in identifying the source. Similarlyfrom_trigger
can be set for asset events created as part of event based scheduling. This will also help in UI whereTrigger
can be mentioned as the source.Another idea but slightly bigger one would be to pass the event payload as extra to the asset event, this will help in passing information from the trigger to the dag that consumes the event.
airflow/airflow/api_connexion/endpoints/asset_endpoint.py
Line 350 in c77c7f0
extra = {"from_trigger": True}
can be passed toregister_asset_change
airflow/airflow/models/trigger.py
Lines 246 to 249 in c77c7f0
Sample usage in
Asset Events
widget in dashboard UI that I am developingUse case/motivation
Helps in identification of the event source from trigger like how it's done through API now.
Related issues
No response
Are you willing to submit a PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: