question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

API for marking the running DAG state to success or failure

See original GitHub issue

Description

Like how we are able to turn OFF the DAG or turn ON the DAG using airflow API, we need a feature where we can mark the running DAG as FAILED or SUCCESS. This feature is needed for us.

I see two methods set_dag_run_state_to_failed and set_dag_run_state_to_success already present in code like how we want. It would be good if we have an API for it.

API’s something like below GET /api/experimental/dags/<DAG_ID>/dag_runs/string:execution_date/SUCCESS GET /api/experimental/dags/<DAG_ID>/dag_runs/string:execution_date/FAILED

Use case / motivation In my application, airflow DAGs are getting stuck in a running state for some reason, we want to mark them as FAILED or SUCCESS and trigger a fresh DAG run, and sometimes while the DAG is in running state we want to abort it based on some predefined conditions. Currently, we are doing this by using airflow UI but we want to use API instead.

Are you willing to submit a PR?

No, I’m not willing to contribute.

Related Issues

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:11 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
sollozzo2commented, Jun 12, 2021

Hi, I am willing to work on this as my first issue.

0reactions
ephraimbuddycommented, Sep 19, 2021

Closed by #17839

Read more comments on GitHub >

github_iconTop Results From Across the Web

DAG Runs — Airflow Documentation
Marking task instances as failed can be done through the UI. This can be used to stop running task instances. Marking task instances...
Read more >
Airflow, mark a task success or skip it before dag run
We want to run just a part of the DAG, and the easiest way that we found is to not add the task...
Read more >
Troubleshooting DAGs | Cloud Composer
In this case, the scheduler marks a given task as a Zombie task. ... the successful state and the execution of the DAG...
Read more >
An introduction to the Airflow UI | Astronomer Documentation
It shows a list of all your DAGs, the status of recent DAG runs and tasks, ... states, the color is a gradient...
Read more >
Airflow State 101 - Towards Data Science
SUCCESS (In both dagrun and task level | finished State): a success state shows that Airflow didn't face any error while running the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found