Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
rawwar committed Oct 19, 2024
1 parent f1dad1c commit 28b6db8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions airflow/api_fastapi/core_api/routes/public/dag_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,12 @@ async def update_dag_run_state(
raise HTTPException(
404, f"The DagRun with dag_id: `{dag_id}` and run_id: `{dag_run_id}` was not found"
)

dag: DAG = request.app.state.dag_bag.get_dag(dag_id)

if not dag:
raise HTTPException(404, f"Dag with id {dag_id} was not found")
print("State is ", state)
print("stats equals", state == DAGRunModifyStates.SUCCESS)

if state.state == DAGRunModifyStates.SUCCESS:
set_dag_run_state_to_success(dag=dag, run_id=dag_run.run_id, commit=True)
elif state.state == DAGRunModifyStates.QUEUED:
Expand Down

0 comments on commit 28b6db8

Please sign in to comment.