about summary refs log tree commit diff
path: root/uploader/phenotypes/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'uploader/phenotypes/models.py')
-rw-r--r--uploader/phenotypes/models.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/uploader/phenotypes/models.py b/uploader/phenotypes/models.py
index 9324601..73b1cce 100644
--- a/uploader/phenotypes/models.py
+++ b/uploader/phenotypes/models.py
@@ -5,8 +5,9 @@ from datetime import datetime
 
 import MySQLdb as mdb
 from MySQLdb.cursors import Cursor, DictCursor
+from flask import current_app as app
 
-from uploader.db_utils import debug_query
+from gn_libs.mysqldb import debug_query
 
 def datasets_by_population(
         conn: mdb.Connection,
@@ -68,7 +69,7 @@ def dataset_phenotypes(conn: mdb.Connection,
             f" LIMIT {limit} OFFSET {offset}" if bool(limit) else "")
     with conn.cursor(cursorclass=DictCursor) as cursor:
         cursor.execute(_query, (population_id, dataset_id))
-        debug_query(cursor)
+        debug_query(cursor, app.logger)
         return tuple(dict(row) for row in cursor.fetchall())
 
 
@@ -201,7 +202,7 @@ def phenotypes_data(conn: mdb.Connection,
                   f" LIMIT {limit} OFFSET {offset}" if bool(limit) else "")
     with conn.cursor(cursorclass=DictCursor) as cursor:
         cursor.execute(_query, (population_id, dataset_id))
-        debug_query(cursor)
+        debug_query(cursor, app.logger)
         return tuple(dict(row) for row in cursor.fetchall())
 
 
@@ -228,5 +229,5 @@ def save_new_dataset(cursor: Cursor,
         "%(created)s, %(public)s, %(population_id)s, %(confidentiality)s, "
         "%(users)s)",
         params)
-    debug_query(cursor)
+    debug_query(cursor, app.logger)
     return {**params, "Id": cursor.lastrowid}