From b4d3611d77646df5444a040b307860ad35a21e9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Manuel=20Dom=C3=ADnguez?= Date: Mon, 24 Jul 2023 14:37:09 +0200 Subject: [PATCH 1/2] Fix parsing tool metadata from bio.tools The keys "topic" and "function" do not exist any longer for many tools. Thus, such tools fail to load. --- lib/galaxy/tool_util/biotools/interface.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/tool_util/biotools/interface.py b/lib/galaxy/tool_util/biotools/interface.py index 6b4a5a7cb4a7..0268de09a3b2 100644 --- a/lib/galaxy/tool_util/biotools/interface.py +++ b/lib/galaxy/tool_util/biotools/interface.py @@ -21,8 +21,8 @@ class BiotoolsEntry: def from_json(from_json: Dict[str, Any]) -> 'BiotoolsEntry': entry = BiotoolsEntry() entry.biotoolsID = from_json["biotoolsID"] - entry.topic = from_json["topic"] - entry.function = from_json["function"] + entry.topic = from_json.get("topic", [{}]) + entry.function = from_json.get("function", [{}]) return entry @property From b1f7c47bf8a2eb7259ab435c64a299c3dda0e591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Manuel=20Dom=C3=ADnguez?= <43052541+kysrpex@users.noreply.github.com> Date: Mon, 24 Jul 2023 16:00:56 +0200 Subject: [PATCH 2/2] Use an empty list as topic and function when they are missing from bio.tools metadata Co-authored-by: Nicola Soranzo --- lib/galaxy/tool_util/biotools/interface.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/tool_util/biotools/interface.py b/lib/galaxy/tool_util/biotools/interface.py index 0268de09a3b2..551541cddba7 100644 --- a/lib/galaxy/tool_util/biotools/interface.py +++ b/lib/galaxy/tool_util/biotools/interface.py @@ -21,8 +21,8 @@ class BiotoolsEntry: def from_json(from_json: Dict[str, Any]) -> 'BiotoolsEntry': entry = BiotoolsEntry() entry.biotoolsID = from_json["biotoolsID"] - entry.topic = from_json.get("topic", [{}]) - entry.function = from_json.get("function", [{}]) + entry.topic = from_json.get("topic", []) + entry.function = from_json.get("function", []) return entry @property