amoghrajesh commented on code in PR #47996:
URL: https://github.com/apache/airflow/pull/47996#discussion_r2006925020
##########
airflow/api_fastapi/execution_api/datamodels/taskinstance.py:
##########
@@ -157,6 +156,23 @@ class TIRescheduleStatePayload(StrictBaseModel):
end_date: UtcDateTime
+class TIRetryStatePayload(StrictBaseModel):
+ """Schema for update TaskInstance to up_for_retry."""
Review Comment:
```suggestion
"""Schema for updating TaskInstance to up_for_retry state."""
```
##########
airflow/api_fastapi/execution_api/datamodels/taskinstance.py:
##########
@@ -197,6 +213,7 @@ def ti_state_discriminator(v: dict[str, str] |
StrictBaseModel) -> str:
Annotated[TITargetStatePayload, Tag("_other_")],
Annotated[TIDeferredStatePayload, Tag("deferred")],
Annotated[TIRescheduleStatePayload, Tag("up_for_reschedule")],
+ Annotated[TIRetryStatePayload, Tag("up_for_retry")],
Review Comment:
We will also have to add the state to the discriminator here:
https://github.com/apache/airflow/pull/47996/files#diff-45c9c5de28078a7e771659267f5d7396e1d37cfd417b0ffc4c637e25c5956569R182-R204,
otherwise it will not acknowledge it and fallthrough to "_other_"
##########
airflow/api_fastapi/execution_api/routes/task_instances.py:
##########
@@ -226,6 +227,7 @@ def ti_run(
variables=[],
connections=[],
xcom_keys_to_clear=xcom_keys,
+ should_retry=_is_eligible_to_retry(ti.state, ti.try_number,
ti.max_retries),
Review Comment:
Yeah this is nice!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]