From 679c9733cc71f88c14eb79d4b2fa8ed2bdd23b13 Mon Sep 17 00:00:00 2001 From: zsloan Date: Tue, 1 Feb 2022 20:01:23 +0000 Subject: Fix retrieve_publish_trait_data query The PublishFreeeze table is actually unnecessary for this query, since the group ID (inbred_set_id) should be passed in and that ID is in the PublishXRef table (so no neeed to join with PublishFreeze) --- gn3/db/traits.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gn3/db/traits.py b/gn3/db/traits.py index 5985c3f..cad53e7 100644 --- a/gn3/db/traits.py +++ b/gn3/db/traits.py @@ -715,17 +715,16 @@ def retrieve_publish_trait_data(trait_info: Dict, conn: Any): "SELECT " "Strain.Name, PublishData.value, PublishSE.error, NStrain.count, " "PublishData.Id " - "FROM (PublishData, Strain, PublishXRef, PublishFreeze) " + "FROM (PublishData, Strain, PublishXRef) " "LEFT JOIN PublishSE ON " "(PublishSE.DataId = PublishData.Id " "AND PublishSE.StrainId = PublishData.StrainId) " "LEFT JOIN NStrain ON " "(NStrain.DataId = PublishData.Id " "AND NStrain.StrainId = PublishData.StrainId) " - "WHERE PublishXRef.InbredSetId = PublishFreeze.InbredSetId " - "AND PublishData.Id = PublishXRef.DataId " + "WHERE PublishData.Id = PublishXRef.DataId " "AND PublishXRef.Id = %(trait_name)s " - "AND PublishFreeze.Id = %(dataset_id)s " + "AND PublishXRef.InbredSetId = %(dataset_id)s " "AND PublishData.StrainId = Strain.Id " "ORDER BY Strain.Name") with conn.cursor() as cursor: -- cgit v1.2.3