From 348057ee134ce0cd918a3033c91f63fcd5d56497 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Tue, 3 Sep 2024 15:05:06 +0300 Subject: Correctly get categories in response. Signed-off-by: Munyoki Kilyungi --- gn3/db/rdf/wiki.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gn3/db/rdf/wiki.py b/gn3/db/rdf/wiki.py index 0ff4483..f945f06 100644 --- a/gn3/db/rdf/wiki.py +++ b/gn3/db/rdf/wiki.py @@ -145,11 +145,9 @@ CONSTRUCT { ) data = results.get("data") for result in data: - categories = result.get("categories") + categories = result.get("categories") or [] if categories and isinstance(categories, str): result["categories"] = [categories] - else: - result["categories"] = [] pmids = result.get("pubmed_ids") if pmids and isinstance(pmids, str): result["pubmed_ids"] = [pmids] -- cgit v1.2.3