about summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2026-01-30 12:28:33 -0600
committerFrederick Muriuki Muriithi2026-01-30 12:28:33 -0600
commitb75aa8b8da8a0dd145e95705e495a0ab37917396 (patch)
tree3201771c3d24bd48087c4e0cf24d2e7ba52ea36f /scripts
parent3691df4c2bfdab29b61be53a6171ed0cb06bf5fc (diff)
downloadgn-uploader-b75aa8b8da8a0dd145e95705e495a0ab37917396.tar.gz
Add messages to script to indicate progress.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/phenotypes/delete_phenotypes.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/phenotypes/delete_phenotypes.py b/scripts/phenotypes/delete_phenotypes.py
index e1396f3..1403216 100644
--- a/scripts/phenotypes/delete_phenotypes.py
+++ b/scripts/phenotypes/delete_phenotypes.py
@@ -24,6 +24,8 @@ def read_xref_ids_file(filepath: Optional[Path]) -> tuple[int, ...]:
     if filepath is None:
         return tuple()
 
+    logger.debug("Using file '%s' to retrieve XREF IDs for deletion.",
+                 filepath.name)
     _ids: tuple[int, ...] = tuple()
     with filepath.open(mode="r") as infile:
         for line in infile.readlines():
@@ -126,16 +128,22 @@ if __name__ == "__main__":
                 assert not (len(xref_ids) > 0 and args.delete_all)
                 xref_ids = (fetch_all_xref_ids(cursor, args.population_id)
                             if args.delete_all else xref_ids)
+                logger.debug("Will delete %s phenotypes and related data",
+                             len(xref_ids))
                 if len(xref_ids) == 0:
                     print("No cross-reference IDs were provided. Aborting.")
                     return 0
 
+                print("Updating authorisations: ", end="")
                 update_auth((args.auth_server_uri, args.auth_token),
                             args.species_id,
                             args.population_id,
                             args.dataset_id,
                             xref_ids)
+                print("OK.")
+                print("Deleting the data: ", end="")
                 delete_phenotypes(cursor, args.population_id, xref_ids=xref_ids)
+                print("OK.")
                 return 0
             except AssertionError:
                 logger.error(