aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzsloan2022-03-31 15:32:17 +0000
committerzsloan2022-03-31 15:39:02 +0000
commit9774e0b4335c85f36707a30debde8a4546bb30f0 (patch)
tree4b647c6e9d00b5108f97edd2f68d4dca439daa32
parent9def45f7116e0e62ab685641a020628db8ff9327 (diff)
downloadgenenetwork2-9774e0b4335c85f36707a30debde8a4546bb30f0.tar.gz
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)
-rw-r--r--wqflask/wqflask/correlation/correlation_gn3_api.py4
1 files 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()),