about summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2025-06-09 14:15:39 -0500
committerFrederick Muriuki Muriithi2025-06-09 14:15:39 -0500
commitb2fb5efe29ca0f7d319346305517445e99c9396b (patch)
treeb1a4257c485afb063ad146011051eb67965a0115 /scripts
parenta952dc61fb2961faa2a1107a2ec92370f10b60cd (diff)
downloadgn-uploader-b2fb5efe29ca0f7d319346305517445e99c9396b.tar.gz
Add debug logging to track process.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/load_phenotypes_to_db.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/load_phenotypes_to_db.py b/scripts/load_phenotypes_to_db.py
index 360cfbb..116605f 100644
--- a/scripts/load_phenotypes_to_db.py
+++ b/scripts/load_phenotypes_to_db.py
@@ -252,12 +252,14 @@ def update_auth(authserver, token, species, population, dataset, xrefdata):
         return urljoin(authserver, endpoint)
 
     def __fetch_user_details__():
+        logger.debug("… Fetching user details")
         return mrequests.get(
             authserveruri("/auth/user/"),
             headers=headers
         )
 
     def __link_data__(user, group):
+        logger.debug("… linking uploaded data to user's group")
         return mrequests.post(
             authserveruri("/auth/data/link/phenotype"),
             headers=headers,
@@ -267,6 +269,7 @@ def update_auth(authserver, token, species, population, dataset, xrefdata):
             }).then(lambda ld_results: (user, ld_results))
 
     def __fetch_phenotype_category_details__(user, linkeddata):
+        logger.debug("… fetching phenotype category details")
         return mrequests.get(
             authserveruri("/auth/resource/categories"),
             headers=headers
@@ -279,6 +282,7 @@ def update_auth(authserver, token, species, population, dataset, xrefdata):
         )
 
     def __create_resource__(user, linkeddata, category):
+        logger.debug("… creating authorisation resource object")
         now = datetime.datetime.now().isoformat()
         return mrequests.post(
             authserveruri("/auth/resource/create"),
@@ -291,6 +295,7 @@ def update_auth(authserver, token, species, population, dataset, xrefdata):
             }).then(lambda cr_results: (user, linkeddata, resource))
 
     def __attach_data_to_resource__(user, linkeddata, resource):
+        logger.debug("… attaching data to authorisation resource object")
         return mrequests.post(
             authserveruri("/auth/resource/data/link"),
             headers=headers,
@@ -385,7 +390,7 @@ def load_data(conn: mysqldb.Connection, job: dict) -> int:
                                     samples=samples,
                                     control_data=_control_data,
                                     filesdir=_outdir)
-    logger.info("Saved %s new phenotype sample counts rows.", num_n_rows)
+    logger.info("Saved %s new phenotype sample counts rows.", _num_n_rows)
     return (_species, _population, _dataset, _xrefs)