'Preserve object type in celery send task kwargs
In the celery send task function can we preserve the type of objects passed to kwargs dictionary. The date-time values passed in the dictionary get converted to strings.
celery_app.send_task(
"NOTIFICATION",
kwargs={
"id": Id,
"notification_endpoint": config.get("notificationEndpoint"),
"detail": detail.to_mongo().to_dict()
}, serializer="json")
The detail object is a nested dict with some values which are DateTime. In the NOTIFICATION task those values get converted to string.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
