Staging instance, all changes can be removed at any time

Skip to content

serializers: Ensure backward compatibility for string serialized timedeltas

datetime.timedelta serialization/deserialization has recently changed in swh-core (67dcf30e).

However, the following snippet now ends up with an error:

import sys
from swh.scheduler import get_scheduler
scheduler = get_scheduler('remote', {'url': 'http://saatchi.internal.softwareheritage.org:5008/'})
scheduler.get_tasks([10270265])

Indeed, the arguments for the task 10270265 are stored in the softwareheritage-scheduler database but those with datetime.timedelta type were serialized using the old method. So their deserialization fail unless some backward compatible method is used.

Related swh-web#1281 (closed)


Migrated from D559 (view on Phabricator)

Merge request reports

Loading