You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I looked into it, the endpoint api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id} and it was giving the right result. In the code, it is seems to be attached to the field _try_number
_try_number = auto_field(data_key="try_number")
but the one we see in the UI is try_number attribute from TaskInstance model which is _try_number + 1 for finished tasks
@hybrid_property
def try_number(self):
"""
Return the try number that this task number will be when it is actually
run.
If the TaskInstance is currently running, this will match the column in the
database, in all other cases this will be incremented.
"""
# This is designed so that task logs end up in the right file.
if self.state == State.RUNNING:
return self._try_number
return self._try_number + 1
So we can, instead of showing try_number we can show _try_number in the UI.
Apache Airflow version
2.6.2
What happened
All tasks were run 1 time. The try number is 2 for all tasks
What you think should happen instead
Try number should be 1 if only tried 1 time
How to reproduce
Run a task and use the UI to look up try number
Operating System
centos
Versions of Apache Airflow Providers
No response
Deployment
Virtualenv installation
Deployment details
No response
Anything else
No response
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: