Bug fix get_item_street_addresses

This commit is contained in:
Edward Betts 2024-06-19 14:32:51 +01:00
parent 938f79ba19
commit ba22e8e9df

View file

@ -951,6 +951,9 @@ def get_item_street_addresses(item: model.Item) -> list[str]:
qualifiers = claim.get("qualifiers") qualifiers = claim.get("qualifiers")
if not qualifiers or "P670" not in qualifiers: if not qualifiers or "P670" not in qualifiers:
continue continue
if "datavalue" not in qualifiers["P670"]:
print(f"datavalue missing in P670 for {item.qid}")
continue
number = qualifiers["P670"][0]["datavalue"]["value"] number = qualifiers["P670"][0]["datavalue"]["value"]
street_item = get_item(claim["mainsnak"]["datavalue"]["value"]["numeric-id"]) street_item = get_item(claim["mainsnak"]["datavalue"]["value"]["numeric-id"])