Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/replay.py
Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | OBJECT_CONVERTERS: Dict[str, Callable[[Dict], BaseModel]] = { | ||||
"metadata_fetcher": MetadataFetcher.from_dict, | "metadata_fetcher": MetadataFetcher.from_dict, | ||||
"raw_extrinsic_metadata": RawExtrinsicMetadata.from_dict, | "raw_extrinsic_metadata": RawExtrinsicMetadata.from_dict, | ||||
"extid": ExtID.from_dict, | "extid": ExtID.from_dict, | ||||
} | } | ||||
# Deprecated, for BW compat only. | # Deprecated, for BW compat only. | ||||
object_converter_fn = OBJECT_CONVERTERS | object_converter_fn = OBJECT_CONVERTERS | ||||
OBJECT_FIXERS = { | OBJECT_FIXERS = { | ||||
anlambert: s/is/if/ | |||||
# drop the metadata field from the revision (if any); this field is | |||||
# about to be dropped from the data model (in favor of | |||||
# raw_extrinsic_metadata) and there can be bogus values in the existing | |||||
# journal (metadata with \0000 in it) | |||||
"revision": partial(remove_keys, keys=("metadata",)), | "revision": partial(remove_keys, keys=("metadata",)), | ||||
} | } | ||||
class ModelObjectDeserializer: | class ModelObjectDeserializer: | ||||
"""A swh.journal object deserializer that checks object validity and reports | """A swh.journal object deserializer that checks object validity and reports | ||||
invalid objects | invalid objects | ||||
▲ Show 20 Lines • Show All 153 Lines • Show Last 20 Lines |
s/is/if/