Skip to content
Discussion options

You must be logged in to vote

You could try to set status of Task Instance to failed

from airflow.utils.state import TaskInstanceState


def retry_callback(context) -> None:
    if True:  # some condition
        ti = context["ti"]
        print(f"Set task instance {ti} state to {TaskInstanceState.FAILED}")
        ti.set_state(TaskInstanceState.FAILED)
        return

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@cmpeburak
Comment options

@edualvess
Comment options

@rwhitt2049
Comment options

Answer selected by cmpeburak
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants