Page MenuHomeSoftware Heritage

serializers: Ensure backward compatibility for string serialized timedeltas
AbandonedPublic

Authored by anlambert on Oct 22 2018, 3:55 PM.

Details

Reviewers
olasd
Summary

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

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 T1281

Diff Detail

Repository
rDCORE Foundations and core functionalities
Branch
timedelta-backward-compatible-deserialization
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 1729
Build 2076: tox-on-jenkins
Build 2075: arc lint + arc unit

Event Timeline

This eval should never have existed in the first place, so I strongly disagree with this change.

If there's some data that has been serialized using the wrong format, the data itself needs to be fixed to be in the new format.

Ok let's abandon this. Issue mentionned above also disappeared after the diff creation.