Skip to content

Store and expose task inlet references to assets #51424

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

Merged
merged 2 commits into from
Jun 18, 2025

Conversation

uranusjr
Copy link
Member

@uranusjr uranusjr commented Jun 5, 2025

Backend part for #50873.

The name 'consuming dags' is somewhat confusing. This is actually a backref to DagScheduleAssetReference, and as the name suggests, it only tracks dags that reference assets in its schedule, not other ways of “consuming”, namely inlet references. Therefore, I changed the name to scheduled_dags instead, to reflect the fact that those dags actually use the asset for scheduling.

I added a new model TaskInletAssetReference to track inlet references. A backref is also created to expose this to the REST API (so we can later show this in the UI). I’m calling this consuming_tasks, but open to other ideas (again, consuming might not be the best word).

Copy link
Contributor

@bugraoz93 bugraoz93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good! Put some comments on the failing tests.
Do you think we should add a newsfragment? Since it also includes changes on the database end, maybe not directly a user-facing feature but could be if someone started using those fields.

@uranusjr
Copy link
Member Author

Good point, I’ll add a news fragment file.

@uranusjr uranusjr force-pushed the asset-consuming-change branch 2 times, most recently from 305d0ff to 067eede Compare June 16, 2025 05:10
The term 'consuming' is confusing here. The implementation of this
property returns a list of dags that use the asset in their 'schedule'
argument (asset-based scheduling). However, a dag can 'consume' an asset
in other ways, e.g. using it as an inlet, which this property does not
handle.
@uranusjr uranusjr force-pushed the asset-consuming-change branch from 067eede to d816b0f Compare June 16, 2025 06:02
@uranusjr uranusjr force-pushed the asset-consuming-change branch from d816b0f to 4b31bf3 Compare June 16, 2025 09:27
Copy link
Member

@pierrejeambrun pierrejeambrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Looks good to me!

@pierrejeambrun pierrejeambrun added this to the Airflow 3.1.0 milestone Jun 17, 2025
@uranusjr uranusjr merged commit f080bc0 into apache:main Jun 18, 2025
97 checks passed
@uranusjr uranusjr deleted the asset-consuming-change branch June 18, 2025 03:19
RoyLee1224 pushed a commit to RoyLee1224/airflow that referenced this pull request Jun 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:airflow-ctl area:API Airflow's REST/HTTP API area:CLI area:DAG-processing area:db-migrations PRs with DB migration area:Scheduler including HA (high availability) scheduler area:UI Related to UI/UX. For Frontend Developers. kind:documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants