anmolxlight opened a new pull request, #72326:
URL: https://github.com/apache/airflow/pull/72326

   Closes #72319
   
   The datetime deserializer only accepted `str|float` for 
`datetime.timedelta`, so integer second values (e.g. `2700` for 45 minutes) 
raised `TypeError: unknown date/time format datetime.timedelta` and crashed the 
scheduler during DeadlineAlert Dag-run creation.
   
   Fix: accept `int` alongside `str|float` — `isinstance(data, str|float|int)`.
   
   Repro:
   
   ```python
   from datetime import timedelta
   from airflow.sdk.serde import CLASSNAME, DATA, VERSION, deserialize
   assert deserialize({CLASSNAME: 'datetime.timedelta', VERSION: 2, DATA: 
2700}) == timedelta(minutes=45)
   ```
   


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