From 4b84e3e109c7e35cf01e1ec4264ae92a2c43c5cd Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Tue, 10 Sep 2024 10:37:59 +0300 Subject: Fix mypy errors. Signed-off-by: Munyoki Kilyungi --- gn3/db/rdf/wiki.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gn3/db/rdf/wiki.py b/gn3/db/rdf/wiki.py index f082096..03945ec 100644 --- a/gn3/db/rdf/wiki.py +++ b/gn3/db/rdf/wiki.py @@ -111,7 +111,7 @@ CONSTRUCT { symbol=symbol, ) results = query_frame_and_compact(query, WIKI_CONTEXT, sparql_uri) - data = [__sanitize_result(result) for result in results.get("data")] + data = [__sanitize_result(result) for result in results.get("data", {})] # See note above in the doc-string results["data"] = sorted(data, key=lambda d: d["created"]) if not data: @@ -169,7 +169,7 @@ CONSTRUCT { """ ).substitute(prefix=RDF_PREFIXES, comment_id=comment_id) results = query_frame_and_compact(query, WIKI_CONTEXT, sparql_uri) - data = [__sanitize_result(result) for result in results.get("data")] + data = [__sanitize_result(result) for result in results.get("data", {})] # See note above in the doc-string results["data"] = sorted(data, key=lambda d: d["version"], reverse=True) return results -- cgit v1.2.3