aboutsummaryrefslogtreecommitdiff
path: root/gn3
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-01-05 07:42:10 +0300
committerFrederick Muriuki Muriithi2022-01-10 08:33:19 +0300
commit66310d955b2543c3f76ad2429b84c80bb9184f38 (patch)
tree79a256d45282774e0500d8f06da245ba7f34b3e9 /gn3
parentc40f8711ab301f46c446db9c162d3806ea1c1f48 (diff)
downloadgenenetwork3-66310d955b2543c3f76ad2429b84c80bb9184f38.tar.gz
Fix dataset retrieval query for `Geno` traits
Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi
Diffstat (limited to 'gn3')
-rw-r--r--gn3/db/partial_correlations.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/gn3/db/partial_correlations.py b/gn3/db/partial_correlations.py
index 0befb34..157f8ee 100644
--- a/gn3/db/partial_correlations.py
+++ b/gn3/db/partial_correlations.py
@@ -540,12 +540,12 @@ def geno_datasets_names(conn, threshold, dataset_names):
"WHERE "
"public > %s "
"AND "
- "(Name = ({names}) OR FullName = ({names}) OR ShortName = ({names}))")
+ "(Name IN ({names}) OR FullName IN ({names}) OR ShortName IN ({names}))")
with conn.cursor(cursorclass=DictCursor) as cursor:
cursor.execute(
query.format(names=", ".join(["%s"] * len(dataset_names))),
- (threshold,) + tuple(dataset_names))
- return ...
+ (threshold,) + (tuple(dataset_names) * 3))
+ return {ds["dataset_name"]: ds for ds in cursor.fetchall()}
return {}
def geno_datasets_groups(conn, dataset_names):