From ae0b2e5a51d2099ecce345595057c701f145ba3e Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Thu, 9 Nov 2023 07:37:28 +0100 Subject: [PATCH] CatalogDict: institution and URL can be None --- depicts/type.py | 4 ++-- depicts/wd_catalog.py | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/depicts/type.py b/depicts/type.py index 3418f47..0ce71b2 100644 --- a/depicts/type.py +++ b/depicts/type.py @@ -28,8 +28,8 @@ class Entity(TypedDict, total=False): class CatalogDict(TypedDict, total=False): """Catalog record from institution web site.""" - institution: str - url: str + institution: str | None + url: str | None ids: set[str] detail: list[dict[str, str]] description: str diff --git a/depicts/wd_catalog.py b/depicts/wd_catalog.py index 22bfa8a..ca5b781 100644 --- a/depicts/wd_catalog.py +++ b/depicts/wd_catalog.py @@ -399,7 +399,6 @@ def get_catalog_from_artwork(entity: Entity) -> CatalogDict: catalog_detail.append(detail) url = wikibase.first_datavalue(entity, "P973") - assert isinstance(url, str) catalog: CatalogDict = { "url": url, "detail": catalog_detail,