aboutsummaryrefslogtreecommitdiff
path: root/gn3/api/heatmaps.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-04-06 12:31:05 +0300
committerFrederick Muriuki Muriithi2023-04-06 12:31:05 +0300
commit17abad9300e4a96a14f94da486ef8307f7d27e06 (patch)
tree38fe3bfd36be9a821adfc67b83fbbd587ceb8b5e /gn3/api/heatmaps.py
parent3d873435f0d464864d4d691d6be4db40931fac05 (diff)
downloadgenenetwork3-17abad9300e4a96a14f94da486ef8307f7d27e06.tar.gz
Remove deprecated `gn3.db_utils.database_connector` function
Remove the deprecated function and fix a myriad of bugs that arise from removing the function. Issue: https://issues.genenetwork.org/issues/bugfix_coupling_current_app_and_db_utils
Diffstat (limited to 'gn3/api/heatmaps.py')
-rw-r--r--gn3/api/heatmaps.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/gn3/api/heatmaps.py b/gn3/api/heatmaps.py
index 80c8ca8..26c165f 100644
--- a/gn3/api/heatmaps.py
+++ b/gn3/api/heatmaps.py
@@ -5,9 +5,9 @@ Module to hold the entrypoint functions that generate heatmaps
import io
from flask import jsonify
from flask import request
-from flask import Blueprint
+from flask import Blueprint, current_app
from gn3.heatmaps import build_heatmap
-from gn3.db_utils import database_connector
+from gn3.db_utils import database_connection
heatmaps = Blueprint("heatmaps", __name__)
@@ -24,7 +24,7 @@ def clustered_heatmaps():
return jsonify({
"message": "You need to provide at least two trait names."
}), 400
- with database_connector() as conn:
+ with database_connection(current_app.config["SQL_URI"]) as conn:
def parse_trait_fullname(trait):
name_parts = trait.split(":")
return f"{name_parts[1]}::{name_parts[0]}"