amoghrajesh commented on code in PR #45030:
URL: https://github.com/apache/airflow/pull/45030#discussion_r1890215446


##########
airflow/api_fastapi/execution_api/datamodels/taskinstance.py:
##########
@@ -83,6 +83,15 @@ class TIDeferredStatePayload(BaseModel):
     next_method: str
     trigger_timeout: timedelta | None = None
 
+    @field_validator("trigger_kwargs", mode="before")
+    def validate_moment(cls, v):
+        from datetime import datetime
+
+        if "moment" in v and isinstance(v["moment"], str):
+            moment = datetime.fromisoformat(v["moment"].replace("Z", "+00:00"))
+            v["moment"] = moment
+        return v

Review Comment:
   Ran the example in debugger, in task_runner.py (it is still some datetime)
   
![image](https://github.com/user-attachments/assets/fccc6327-229b-4ff9-a70a-dc9d37eaa624)
   
   
   Added a print in the server (it is a str):
   
![image](https://github.com/user-attachments/assets/2ab94e80-ff5f-493c-acdf-cd7401711743)
   



-- 
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]

Reply via email to