-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
Conversation
FYI. Not sure if it helps but OpenAPI 3.2.0 will have support for |
231597b
to
007a051
Compare
I added some tests for the endpoint, but couldn’t figure out how to test the looping part. Hopefully this is good enough… |
There was a problem hiding this 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.
airflow-core/src/airflow/api_fastapi/core_api/datamodels/dag_run.py
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_run.py
Outdated
Show resolved
Hide resolved
airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_dag_run.py
Show resolved
Hide resolved
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_run.py
Outdated
Show resolved
Hide resolved
007a051
to
152bd6d
Compare
There was a problem hiding this 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
airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_dag_run.py
Outdated
Show resolved
Hide resolved
airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_dag_run.py
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml
Show resolved
Hide resolved
152bd6d
to
34badc1
Compare
96812e6
to
422cd94
Compare
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_run.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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
422cd94
to
58d7fa5
Compare
Tracking doc addition #53067 |
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.