diff options
author | BonfaceKilz | 2022-02-22 12:36:26 +0300 |
---|---|---|
committer | BonfaceKilz | 2022-03-12 15:33:09 +0300 |
commit | 83bfe825ece64807a96280fda9cb4ef3e8ac0587 (patch) | |
tree | 77d9783f1f7552b31019f26707033413fd33bae2 | |
parent | 6bc7d5448970311c01aebae76c2189cf1a6aea59 (diff) | |
download | genenetwork3-83bfe825ece64807a96280fda9cb4ef3e8ac0587.tar.gz |
db: Fix error in SQL query
* gn3/db/traits.py (get_trait_csv_sample_data): Update SQL to fix runtime
errors.
-rw-r--r-- | gn3/db/traits.py | 4 |
1 files changed, 2 insertions, 2 deletions
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 = {} |