From 66310d955b2543c3f76ad2429b84c80bb9184f38 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Wed, 5 Jan 2022 07:42:10 +0300 Subject: 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 --- gn3/db/partial_correlations.py | 6 +++--- 1 file 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): -- cgit v1.2.3