amoghrajesh commented on code in PR #44241:
URL: https://github.com/apache/airflow/pull/44241#discussion_r1858660595
##########
airflow/api_fastapi/execution_api/routes/task_instances.py:
##########
@@ -122,6 +126,39 @@ def ti_update_state(
)
elif isinstance(ti_patch_payload, TITerminalStatePayload):
query = TI.duration_expression_update(ti_patch_payload.end_date,
query, session.bind)
+ elif isinstance(ti_patch_payload, TIDeferredStatePayload):
+ # Calculate timeout if it was passed
+ trigger_timeout: datetime | None = None
+ if ti_patch_payload.timeout is not None:
+ trigger_timeout = timezone.utcnow() + ti_patch_payload.timeout
+ else:
+ trigger_timeout = None
+
+ defer = TaskDeferred(
+ trigger=None,
+ method_name=ti_patch_payload.next_method,
+ kwargs=ti_patch_payload.kwargs,
+ timeout=None,
+ )
+
+ classpath, _, _ = defer.serialize()
+ trigger_row = Trigger(
+ classpath=classpath,
+ kwargs=ti_patch_payload.kwargs,
+ )
+ session.add(trigger_row)
Review Comment:
Ah yes, good catch! Let me try doing something like:
```
"{Trigger.__module__}.{Trigger.__name__}"
```
--
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]