aboutsummaryrefslogtreecommitdiff
path: root/gn3
diff options
context:
space:
mode:
authorArun Isaac2021-12-23 13:57:04 +0530
committerArun Isaac2021-12-23 13:57:04 +0530
commit36cc8b1f837406d7002246c00d6054573687c472 (patch)
tree272a81727d5796a13b56f862b34d35f821c072e0 /gn3
parentdeca94c7b473ec79c5e5cee3d6caeb3c3885bd74 (diff)
downloadgenenetwork3-36cc8b1f837406d7002246c00d6054573687c472.tar.gz
db: Fix sparql_query return type.
* gn3/db/datasets.py: Import List from typing. (sparql_query): Set return type to List[Dict[str, Any]].
Diffstat (limited to 'gn3')
-rw-r--r--gn3/db/datasets.py4
1 files changed, 2 insertions, 2 deletions
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)