-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Add GetDagState endpoint to execution_api #56955
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
base: main
Are you sure you want to change the base?
Add GetDagState endpoint to execution_api #56955
Conversation
|
Not sure we can treat this as bugfix and backport to v3-1. |
27d7704 to
ff8bad8
Compare
| @staticmethod | ||
| def get_dag_state(dag_id: str) -> DagStateResult: | ||
| """Return the state of the Dag run with the given Run ID.""" | ||
| response = SUPERVISOR_COMMS.send(msg=GetDagState(dag_id=dag_id)) | ||
|
|
||
| if TYPE_CHECKING: | ||
| assert isinstance(response, DagStateResult) | ||
|
|
||
| return response | ||
|
|
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.
What is going to call this?
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.
Yeah am planning provider change in separate PR. calling that function here https://github.com/apache/airflow/blob/main/providers/standard/src/airflow/providers/standard/operators/trigger_dagrun.py#L221.
|
@gopidesupavan @kaxil Rather than a seaprate check, how about adding this as a parameter to the existing TriggerRun message and API endpoint -- and then if the dag is paused the API could return an error (412 Precondition Failed for giggles?) which could then be returned to the task code |
Yeah thats also an option good thought, but for now there is no-way if anyone wants to see dag status. not sure is it worth adding this endpoint or not. am happy to make a change if this is not required. |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions. |
360e013 to
5581f56
Compare
5581f56 to
d44eb85
Compare
84ca7ee to
4791527
Compare
related: #56954
TriggerDagRunOperator failing when the operator args sets
fail_when_dag_is_pausedin AF3 we are blocking the db access, but in the current TriggerDagRunOperator it still trying to use the DagModel, causing the db error. see the issue above where user explained.here its accessing DagModel.
https://github.com/apache/airflow/blob/main/providers/standard/src/airflow/providers/standard/operators/trigger_dagrun.py#L219
Adding the GetDagState endpoint to get whether dag is paused or in active.
Fix is required for the TriggerDagRunOperator in standard provider, after this merge will add a fix.
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.