Skip to content

How can I know if the current execution is a retry? #12583

Answered by sryza
sryza asked this question in Q&A
Discussion options

You must be logged in to vote

You can use context.retry_number.

@op(retry_policy=RetryPolicy(max_retries=2))
def my_op(context):
    is_retry = context.retry_number > 0
    ...

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@RWiggers
Comment options

Answer selected by sryza
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
area: ops/graphs/jobs Related to Dagster ops, graphs and jobs
2 participants