From 83bfe825ece64807a96280fda9cb4ef3e8ac0587 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Tue, 22 Feb 2022 12:36:26 +0300 Subject: db: Fix error in SQL query * gn3/db/traits.py (get_trait_csv_sample_data): Update SQL to fix runtime errors. --- gn3/db/traits.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gn3/db') diff --git a/gn3/db/traits.py b/gn3/db/traits.py index f686097..04b2a70 100644 --- a/gn3/db/traits.py +++ b/gn3/db/traits.py @@ -84,7 +84,7 @@ def get_trait_csv_sample_data(conn: Any, """Fetch a trait and return it as a csv string""" __query = ("SELECT concat(st.Name, ',', ifnull(pd.value, 'x'), ',', " "ifnull(ps.error, 'x'), ',', ifnull(ns.count, 'x')) as 'Data' " - "ifnull(ca.Name, 'x') as 'CaseAttr', " + ",ifnull(ca.Name, 'x') as 'CaseAttr', " "ifnull(cxref.value, 'x') as 'Value' " "FROM PublishFreeze pf " "JOIN PublishXRef px ON px.InbredSetId = pf.InbredSetId " @@ -97,7 +97,7 @@ def get_trait_csv_sample_data(conn: Any, "LEFT JOIN CaseAttributeXRefNew cxref ON " "(cxref.InbredSetId = px.InbredSetId AND " "cxref.StrainId = st.Id) " - "LEFT JOIN CaseAttribute ca ON ca.Id = cxref.CaseAttributeId" + "LEFT JOIN CaseAttribute ca ON ca.Id = cxref.CaseAttributeId " "WHERE px.Id = %s AND px.PhenotypeId = %s ORDER BY st.Name") case_attr_columns = set() csv_data = {} -- cgit v1.2.3