Skip to content

Add endpoint to watch dag run until finish #51920

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 5 commits into from
Jul 9, 2025

Conversation

uranusjr
Copy link
Member

@uranusjr uranusjr commented Jun 19, 2025

Close #51711.

I initially wanted to just enhance the trigger endpoint to optionally stream until the run finishes, but it seems that FastAPI does not like this optionally stream idea. You can do it of course, but would loose a lot of the auto annotation reflection feature. So I opted to have a separate streaming endpoint instead.

This endpoint repeatedly emits a JSON object at the specified interval, until the dag reaches a finished state.

Tests to come.

@boring-cyborg boring-cyborg bot added area:API Airflow's REST/HTTP API area:UI Related to UI/UX. For Frontend Developers. labels Jun 19, 2025
@potiuk
Copy link
Member

potiuk commented Jun 19, 2025

FYI. Not sure if it helps but OpenAPI 3.2.0 will have support for application/json-seq OAI/OpenAPI-Specification#3730 (planned for August)

@uranusjr uranusjr added this to the Airflow 3.1.0 milestone Jun 24, 2025
@uranusjr uranusjr force-pushed the stream-until-run-complete branch 2 times, most recently from 231597b to 007a051 Compare June 25, 2025 04:53
@uranusjr
Copy link
Member Author

I added some tests for the endpoint, but couldn’t figure out how to test the looping part. Hopefully this is good enough…

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, just a few suggestions / nits.

Indeed an additional test case for running / success state would be great.

@uranusjr uranusjr force-pushed the stream-until-run-complete branch from 007a051 to 152bd6d Compare July 3, 2025 09:31
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.

LGTM, thanks.

Just a few nits, but nothing blocking

@uranusjr uranusjr force-pushed the stream-until-run-complete branch from 152bd6d to 34badc1 Compare July 7, 2025 07:04
@uranusjr uranusjr force-pushed the stream-until-run-complete branch 2 times, most recently from 96812e6 to 422cd94 Compare July 7, 2025 19:27
Copy link
Member

@kaxil kaxil left a comment

Choose a reason for hiding this comment

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

Some simple docs would be good. Fine as a follow-up too as long as we have a GH issue to not forget.

@vikramkoka could review that too

@uranusjr uranusjr force-pushed the stream-until-run-complete branch from 422cd94 to 58d7fa5 Compare July 9, 2025 05:40
@uranusjr
Copy link
Member Author

uranusjr commented Jul 9, 2025

Tracking doc addition #53067

@uranusjr uranusjr merged commit 5fbbf64 into apache:main Jul 9, 2025
102 checks passed
@uranusjr uranusjr deleted the stream-until-run-complete branch July 9, 2025 06:34
HsiuChuanHsu pushed a commit to HsiuChuanHsu/airflow that referenced this pull request Jul 10, 2025
stephen-bracken pushed a commit to stephen-bracken/airflow that referenced this pull request Jul 15, 2025
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable Inference Execution / Synchronous DAG Execution
6 participants