From 88409852cf175d4a27755df7871f5abbb7949368 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Sat, 4 May 2024 07:02:30 +0000 Subject: [PATCH 1/4] Bug fix --- matcher/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matcher/api.py b/matcher/api.py index 7be38c3..9c1d431 100644 --- a/matcher/api.py +++ b/matcher/api.py @@ -1020,7 +1020,7 @@ def item_detail(item: model.Item) -> ItemDetailType: ) isa_items = [get_item(isa["numeric-id"]) for isa in item.get_isa()] - isa_lookup = {isa.qid: isa for isa in isa_items} + isa_lookup = {isa.qid: isa for isa in isa_items if isa} wikipedia_links = [ {"lang": site[:-4], "title": link["title"]} From eb6631ab05b151c3c39e92bee038dc203df709e4 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Sat, 4 May 2024 07:03:00 +0000 Subject: [PATCH 2/4] Increase timeout --- matcher/database.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matcher/database.py b/matcher/database.py index ccd022b..78162cf 100644 --- a/matcher/database.py +++ b/matcher/database.py @@ -10,7 +10,7 @@ from sqlalchemy.orm import scoped_session, sessionmaker session: sqlalchemy.orm.scoping.scoped_session = scoped_session(sessionmaker()) -timeout = 2_000 # 20 seconds +timeout = 20_000 # 20 seconds def init_db(db_url: str, echo: bool = False) -> None: From b8ed31e20105dca65dcffcaa0af1d350e57a6138 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Sat, 4 May 2024 07:03:47 +0000 Subject: [PATCH 3/4] package.json: Add eslint as devDependencies --- package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package.json b/package.json index 4cd71ad..29251d7 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,8 @@ }, "devDependencies": { "@vitejs/plugin-vue": "^4.4.0", + "eslint": "^9.2.0", + "eslint-plugin-vue": "^9.25.0", "rollup-plugin-esm-import-to-url": "^2.1.0", "vite": "^4.5.0" } From f39d2dd680cb87fd500e265aba837a87da3fee60 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Sat, 4 May 2024 07:05:55 +0000 Subject: [PATCH 4/4] nominatim hit extratags can be null --- matcher/nominatim.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matcher/nominatim.py b/matcher/nominatim.py index 279b669..c15b8fc 100644 --- a/matcher/nominatim.py +++ b/matcher/nominatim.py @@ -118,7 +118,7 @@ def get_hit_name(hit: Hit) -> str: def get_hit_label(hit: Hit) -> str: """Parse hit and generate label.""" - tags = hit["extratags"] + tags = hit["extratags"] or {} designation = tags.get("designation") category = hit["category"] hit_type = hit["type"]