When calling update_media_buy with start_time or end_time, the operation fails with:
can't subtract offset-naive and offset-aware datetimes
This occurs because the code mixes timezone-aware datetimes (from request parsing) with potentially timezone-naive datetimes (from database).
Symptoms:
{
"success": false,
"status": "completed",
"error": "A2A agent returned error: Unable to update media buy: can't subtract offset-naive and offset-aware datetimes"
}
When updating only end_time:
- start_dt = media_buy.start_time from database (possibly naive)
- end_dt = parsed from request with timezone (aware)
- Subtraction fails
When calling update_media_buy with start_time or end_time, the operation fails with:
This occurs because the code mixes timezone-aware datetimes (from request parsing) with potentially timezone-naive datetimes (from database).
Symptoms:
When updating only end_time: