From 9774e0b4335c85f36707a30debde8a4546bb30f0 Mon Sep 17 00:00:00 2001
From: zsloan
Date: Thu, 31 Mar 2022 15:32:17 +0000
Subject: Fix the way database_connector is called

The function returns a call to mdb.connect, which only returns the
connection object. It was throwing an error due to trying to unpack
multiple items.

One thing I noticed while looking at this is that we should probably
decide on a single way to create these connections. In some other files,
we instead use database_connection from wqflask.database (instead of the
gn3 database_connector from gn3.db_utils)
---
 wqflask/wqflask/correlation/correlation_gn3_api.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/wqflask/wqflask/correlation/correlation_gn3_api.py b/wqflask/wqflask/correlation/correlation_gn3_api.py
index c2acd648..caa9b619 100644
--- a/wqflask/wqflask/correlation/correlation_gn3_api.py
+++ b/wqflask/wqflask/correlation/correlation_gn3_api.py
@@ -146,7 +146,7 @@ def lit_for_trait_list(corr_results, this_dataset, this_trait):
     geneid_dict = {trait_name: geneid for (trait_name, geneid) in geneid_dict.items() if
                    trait_lists.get(trait_name)}
 
-    conn, _cursor_object = database_connector()
+    conn = database_connector()
 
     with conn:
 
@@ -244,7 +244,7 @@ def compute_correlation(start_vars, method="pearson", compute_all=False):
         (this_trait_geneid, geneid_dict, species) = do_lit_correlation(
             this_trait, this_dataset)
 
-        conn, _cursor_object = database_connector()
+        conn = database_connector()
         with conn:
             correlation_results = compute_all_lit_correlation(
                 conn=conn, trait_lists=list(geneid_dict.items()),
-- 
cgit v1.2.3