aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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")