Skip to content

Commit b392118

Browse files
committed
fix(ingest): annotate compact entity cache payload
Refs #99 Refs GetTechAPI/TechAPI#295
1 parent 52e632e commit b392118

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎app/ingest/wikidata_fill.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@
3232

3333
def compact(entity: dict[str, Any]) -> dict[str, Any]:
3434
"""Discard unrelated claims, qualifiers and references from the fill cache."""
35-
result = {key: entity[key] for key in ("id", "missing", "redirect", "lastrevid", "labels")
36-
if key in entity}
35+
result: dict[str, Any] = {
36+
key: entity[key] for key in ("id", "missing", "redirect", "lastrevid", "labels")
37+
if key in entity
38+
}
3739
result["claims"] = {
3840
prop: [{"rank": s.get("rank", "normal"), "mainsnak": s.get("mainsnak", {})}
3941
for s in statements]

0 commit comments

Comments
 (0)