about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2025-05-19 15:46:13 -0500
committerFrederick Muriuki Muriithi2025-05-19 15:46:13 -0500
commit72ee14772f1567b5410a2c907ad0dfab7a8e4670 (patch)
tree6664dd1ca33ecd286657666740f81a52c4473148
parentc93c63ee8464a41cdea5640eb4d1f8a451b62550 (diff)
downloadgn-uploader-72ee14772f1567b5410a2c907ad0dfab7a8e4670.tar.gz
Bug: Connection objects do not have execute() function.
-rw-r--r--scripts/load_phenotypes_to_db.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/load_phenotypes_to_db.py b/scripts/load_phenotypes_to_db.py
index 9721263..c034212 100644
--- a/scripts/load_phenotypes_to_db.py
+++ b/scripts/load_phenotypes_to_db.py
@@ -305,6 +305,7 @@ if __name__ == "__main__":
         setup_logging(args.log_level.upper())
 
         with (mysqldb.database_connection(args.db_uri) as conn,
+              conn.cursor(cursorclass=DictCursor) as cursor,
               sqlite3.connection(args.jobs_db_path) as jobs_conn):
             # Lock the PublishXRef/PublishData/PublishSE/NStrain here: Why?
             #     The `DataId` values are sequential, but not auto-increment
@@ -320,7 +321,7 @@ if __name__ == "__main__":
                 "PublishData",
                 "PublishSE",
                 "NStrain")
-            conn.execute(# Lock the tables to avoid race conditions
+            cursor.execute(# Lock the tables to avoid race conditions
                 "LOCK TABLES "
                          "PublishXRef WRITE, "
                          "PublishData WRITE, "
@@ -336,7 +337,7 @@ if __name__ == "__main__":
                              stack_info=True)
 
             logger.debug("Unlocking all database tables.")
-            conn.execute("UNLOCK TABLES")
+            cursor.execute("UNLOCK TABLES")
 
         return 1