Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add from_trigger field to AssetEvent extra for events from Trigger #44944

Open
2 tasks done
tirkarthi opened this issue Dec 15, 2024 · 3 comments
Open
2 tasks done

Add from_trigger field to AssetEvent extra for events from Trigger #44944

tirkarthi opened this issue Dec 15, 2024 · 3 comments
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

Comments

@tirkarthi
Copy link
Contributor

Description

Currently when API is used to create an asset event from_rest_api is set as True in extra for the AssetEvent . This helps in identifying the source. Similarly from_trigger can be set for asset events created as part of event based scheduling. This will also help in UI where Trigger 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.

extra["from_rest_api"] = True

extra = {"from_trigger": True} can be passed to register_asset_change

AssetManager.register_asset_change(
asset=asset.to_public(),
session=session,
)

Sample usage in Asset Events widget in dashboard UI that I am developing

image

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

  • Yes I am willing to submit a PR!

Code of Conduct

@tirkarthi tirkarthi added kind:feature Feature Requests needs-triage label for new issues that we didn't triage yet labels Dec 15, 2024
@tirkarthi
Copy link
Contributor Author

cc: @vincbeck

@dosubot dosubot bot added area:API Airflow's REST/HTTP API area:UI Related to UI/UX. For Frontend Developers. labels Dec 15, 2024
@tirkarthi
Copy link
Contributor Author

The idea about passing trigger event to asset event is something like #37810 but that trigger's submitted event payload is passed to dataset event. This could be an issue on it's own I guess. cc: @uranusjr @Lee-W

@Lee-W
Copy link
Member

Lee-W commented Dec 17, 2024

I think it's ok to add an from_trigger field here. There's no fix format for extra so shouldn't be a problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

2 participants