From 36cc8b1f837406d7002246c00d6054573687c472 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Thu, 23 Dec 2021 13:57:04 +0530 Subject: db: Fix sparql_query return type. * gn3/db/datasets.py: Import List from typing. (sparql_query): Set return type to List[Dict[str, Any]]. --- gn3/db/datasets.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gn3') diff --git a/gn3/db/datasets.py b/gn3/db/datasets.py index 788e9cf..ca48156 100644 --- a/gn3/db/datasets.py +++ b/gn3/db/datasets.py @@ -3,7 +3,7 @@ This module contains functions relating to specific trait dataset manipulation """ import re from string import Template -from typing import Any, Dict, Optional +from typing import Any, Dict, List, Optional from SPARQLWrapper import JSON, SPARQLWrapper from gn3.settings import SPARQL_ENDPOINT @@ -297,7 +297,7 @@ def retrieve_trait_dataset(trait_type, trait, threshold, conn): **group } -def sparql_query(query: str) -> Dict[str, Any]: +def sparql_query(query: str) -> List[Dict[str, Any]]: """Run a SPARQL query and return the bound variables.""" sparql = SPARQLWrapper(SPARQL_ENDPOINT) sparql.setQuery(query) -- cgit v1.2.3