Changeset View
Changeset View
Standalone View
Standalone View
swh/indexer/metadata.py
Show First 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | |||||
class ExtrinsicMetadataIndexer( | class ExtrinsicMetadataIndexer( | ||||
BaseIndexer[Sha1Git, RawExtrinsicMetadata, OriginExtrinsicMetadataRow] | BaseIndexer[Sha1Git, RawExtrinsicMetadata, OriginExtrinsicMetadataRow] | ||||
): | ): | ||||
def process_journal_objects(self, objects: ObjectsDict) -> Dict: | def process_journal_objects(self, objects: ObjectsDict) -> Dict: | ||||
summary: Dict[str, Any] = {"status": "uneventful"} | summary: Dict[str, Any] = {"status": "uneventful"} | ||||
try: | try: | ||||
results = [] | results = [] | ||||
for item in objects.get("raw_extrinsic_metadata", []): | for item in objects.get("raw_extrinsic_metadata", []): | ||||
id_ = item.get("id") | |||||
if not id_: | |||||
vlorentz: `%s %r` but a single argument | |||||
self.log.warning("Missing 'id' key entry in item %r", item) | |||||
continue | |||||
results.extend( | results.extend( | ||||
self.index(item["id"], data=RawExtrinsicMetadata.from_dict(item)) | self.index(item["id"], data=RawExtrinsicMetadata.from_dict(item)) | ||||
) | ) | ||||
except Exception: | except Exception: | ||||
if not self.catch_exceptions: | if not self.catch_exceptions: | ||||
raise | raise | ||||
summary["status"] = "failed" | summary["status"] = "failed" | ||||
return summary | return summary | ||||
▲ Show 20 Lines • Show All 454 Lines • Show Last 20 Lines |
%s %r but a single argument