aboutsummaryrefslogtreecommitdiff
path: root/wqflask/base/data_set/datasetgroup.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-06-22 16:31:18 +0300
committerzsloan2023-06-22 10:18:31 -0500
commit971d29e82391cc269405f59b5aad5f31061b633d (patch)
treebfcb63ab18aebfa1aa13c3f7319ce28e734fceb6 /wqflask/base/data_set/datasetgroup.py
parent18e2c59a2eb9b1bf952bec6ddfec0cd1abc7cc89 (diff)
downloadgenenetwork2-971d29e82391cc269405f59b5aad5f31061b633d.tar.gz
Update calls to `database_connection` function
Pass in the database URI at call time.
Diffstat (limited to 'wqflask/base/data_set/datasetgroup.py')
-rw-r--r--wqflask/base/data_set/datasetgroup.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/wqflask/base/data_set/datasetgroup.py b/wqflask/base/data_set/datasetgroup.py
index 72577f38..95dc976f 100644
--- a/wqflask/base/data_set/datasetgroup.py
+++ b/wqflask/base/data_set/datasetgroup.py
@@ -15,6 +15,7 @@ from utility.tools import (
locate,
USE_REDIS,
flat_files,
+ get_setting,
flat_file_exists,
locate_ignore_error)
@@ -29,7 +30,7 @@ class DatasetGroup:
def __init__(self, dataset, name=None):
"""This sets self.group and self.group_id"""
- with database_connection() as conn, conn.cursor() as cursor:
+ with database_connection(get_setting("SQL_URI")) as conn, conn.cursor() as cursor:
if not name:
cursor.execute(dataset.query_for_group,
(dataset.name,))
@@ -64,7 +65,7 @@ class DatasetGroup:
def get_mapping_methods(self):
mapping_id = ()
- with database_connection() as conn, conn.cursor() as cursor:
+ with database_connection(get_setting("SQL_URI")) as conn, conn.cursor() as cursor:
cursor.execute(
"SELECT MappingMethodId FROM "
"InbredSet WHERE Name= %s",