aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2025-05-30 13:54:19 -0500
committerFrederick Muriuki Muriithi2025-05-30 13:54:19 -0500
commit2f80e1246b78841a9cde301ada104ae9370b36f1 (patch)
tree7089338805d337f3855807d79ee3095e1cefae04 /scripts
parent3f3155dfba9d7467237f45af059df376fc82f117 (diff)
downloadgn-uploader-2f80e1246b78841a9cde301ada104ae9370b36f1.tar.gz
Add typing to load_data function and invoke it.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/load_phenotypes_to_db.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/load_phenotypes_to_db.py b/scripts/load_phenotypes_to_db.py
index 53009d8..99b56d7 100644
--- a/scripts/load_phenotypes_to_db.py
+++ b/scripts/load_phenotypes_to_db.py
@@ -232,7 +232,7 @@ def update_auth(user, species, population, dataset, phenos):
pass
-def load_data(conn, job):
+def load_data(conn: mysqldb.Connection, job: dict) -> int:
"""Load the data attached in the given job."""
_job_metadata = job["metadata"]
# Steps
@@ -341,6 +341,7 @@ if __name__ == "__main__":
cursor.execute(# Lock the tables to avoid race conditions
"LOCK TABLES " + ", ".join(
f"{_table} WRITE" for _table in _db_tables_))
+ return load_data(conn, jobs.job(jobs_conn, args.job_id))
logger.debug("Unlocking all database tables.")
cursor.execute("UNLOCK TABLES")