aboutsummaryrefslogtreecommitdiff
path: root/uploader/phenotypes
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2025-05-30 13:11:33 -0500
committerFrederick Muriuki Muriithi2025-05-30 13:11:33 -0500
commit0f8772f572ad86e41d1dccda99e4bb1d4551b51a (patch)
tree5e325a4004d4563d5f6b21507a4c3f7e77c1e356 /uploader/phenotypes
parent3e226164ca02cbf56704672ca9549bf1cd9dd349 (diff)
downloadgn-uploader-0f8772f572ad86e41d1dccda99e4bb1d4551b51a.tar.gz
Use full table names rather than aliases
Using aliases leads to errors when you have to use table locking to prevent data corruption. This commit updates queries to use the full table names rather than aliases, in order to prevent such troubles.
Diffstat (limited to 'uploader/phenotypes')
-rw-r--r--uploader/phenotypes/models.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/uploader/phenotypes/models.py b/uploader/phenotypes/models.py
index 48e64da..4454ba3 100644
--- a/uploader/phenotypes/models.py
+++ b/uploader/phenotypes/models.py
@@ -36,10 +36,10 @@ def dataset_by_id(conn: mdb.Connection,
"""Fetch dataset details by identifier"""
with conn.cursor(cursorclass=DictCursor) as cursor:
cursor.execute(
- "SELECT s.SpeciesId, pf.* FROM Species AS s "
- "INNER JOIN InbredSet AS iset ON s.Id=iset.SpeciesId "
- "INNER JOIN PublishFreeze AS pf ON iset.Id=pf.InbredSetId "
- "WHERE s.Id=%s AND iset.Id=%s AND pf.Id=%s",
+ "SELECT Species.SpeciesId, PublishFreeze.* FROM Species "
+ "INNER JOIN InbredSet ON Species.Id=InbredSet.SpeciesId "
+ "INNER JOIN PublishFreeze ON InbredSet.Id=PublishFreeze.InbredSetId "
+ "WHERE Species.Id=%s AND InbredSet.Id=%s AND PublishFreeze.Id=%s",
(species_id, population_id, dataset_id))
return dict(cursor.fetchone())