mainsnak["datavalue"]["value"] can be a dict
This commit is contained in:
parent
4446cbed6e
commit
f33f4b6394
|
@ -13,7 +13,7 @@ def first_datavalue(
|
||||||
mainsnak = entity["claims"][pid][0]["mainsnak"]
|
mainsnak = entity["claims"][pid][0]["mainsnak"]
|
||||||
if "datavalue" in mainsnak:
|
if "datavalue" in mainsnak:
|
||||||
v = mainsnak["datavalue"]["value"]
|
v = mainsnak["datavalue"]["value"]
|
||||||
assert isinstance(v, str | int)
|
assert isinstance(v, (str, int, dict))
|
||||||
return v
|
return v
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue