From 72ee14772f1567b5410a2c907ad0dfab7a8e4670 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 19 May 2025 15:46:13 -0500 Subject: Bug: Connection objects do not have execute() function. --- scripts/load_phenotypes_to_db.py | 5 +++-- 1 file 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 -- cgit v1.2.3