ephraimbuddy commented on a change in pull request #18370:
URL: https://github.com/apache/airflow/pull/18370#discussion_r713396773
##########
File path: airflow/api_connexion/endpoints/dag_run_endpoint.py
##########
@@ -302,6 +306,10 @@ def update_dag_run_state(dag_id: str, dag_run_id: str,
session) -> dict:
raise BadRequest(detail=str(err))
state = post_body['state']
- dag_run.set_state(state=DagRunState(state))
- session.merge(dag_run)
+ dag = current_app.dag_bag.get_dag(dag_id)
+ if state == State.SUCCESS:
+ set_dag_run_state_to_success(dag, dag_run.execution_date, commit=True)
+ else:
+ set_dag_run_state_to_failed(dag, dag_run.execution_date, commit=True)
Review comment:
You can check the test cases for this endpoint
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]