CatalogDict: institution and URL can be None
This commit is contained in:
parent
f33f4b6394
commit
ae0b2e5a51
|
@ -28,8 +28,8 @@ class Entity(TypedDict, total=False):
|
||||||
class CatalogDict(TypedDict, total=False):
|
class CatalogDict(TypedDict, total=False):
|
||||||
"""Catalog record from institution web site."""
|
"""Catalog record from institution web site."""
|
||||||
|
|
||||||
institution: str
|
institution: str | None
|
||||||
url: str
|
url: str | None
|
||||||
ids: set[str]
|
ids: set[str]
|
||||||
detail: list[dict[str, str]]
|
detail: list[dict[str, str]]
|
||||||
description: str
|
description: str
|
||||||
|
|
|
@ -399,7 +399,6 @@ def get_catalog_from_artwork(entity: Entity) -> CatalogDict:
|
||||||
catalog_detail.append(detail)
|
catalog_detail.append(detail)
|
||||||
|
|
||||||
url = wikibase.first_datavalue(entity, "P973")
|
url = wikibase.first_datavalue(entity, "P973")
|
||||||
assert isinstance(url, str)
|
|
||||||
catalog: CatalogDict = {
|
catalog: CatalogDict = {
|
||||||
"url": url,
|
"url": url,
|
||||||
"detail": catalog_detail,
|
"detail": catalog_detail,
|
||||||
|
|
Loading…
Reference in a new issue