diff --git a/swh/storage/cassandra/storage.py b/swh/storage/cassandra/storage.py --- a/swh/storage/cassandra/storage.py +++ b/swh/storage/cassandra/storage.py @@ -228,6 +228,7 @@ if counter >= limit: next_page_token = str(tok) break + row_d["ctime"] = row.ctime.replace(tzinfo=datetime.timezone.utc) contents.append(Content(**row_d)) assert len(contents) <= limit @@ -240,7 +241,7 @@ # matches the argument, from the index table ('content_by_sha1') for row in self._content_get_from_hash("sha1", sha1): row_d = row.to_dict() - row_d.pop("ctime") + row_d["ctime"] = row.ctime.replace(tzinfo=datetime.timezone.utc) content = Content(**row_d) contents_by_sha1[content.sha1] = content return [contents_by_sha1.get(sha1) for sha1 in contents]