aboutsummaryrefslogtreecommitdiff
path: root/wqflask/base
diff options
context:
space:
mode:
authorzsloan2020-07-14 12:12:21 -0500
committerzsloan2020-07-14 12:12:21 -0500
commit05e82353739c2abea6adcfd0036086dc79cee659 (patch)
tree1fa9a58e5035ed18348a5bc771c0b431a903aed0 /wqflask/base
parent67f12c466506f4d7161e3d6319019b523d1416e2 (diff)
downloadgenenetwork2-05e82353739c2abea6adcfd0036086dc79cee659.tar.gz
Added binary casting to phenotype trait info query to fix unicode issue
Diffstat (limited to 'wqflask/base')
-rw-r--r--wqflask/base/trait.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py
index ecb9dcd9..f9da7b87 100644
--- a/wqflask/base/trait.py
+++ b/wqflask/base/trait.py
@@ -395,11 +395,14 @@ def retrieve_trait_info(trait, dataset, get_qtl_info=False):
query = """
SELECT
PublishXRef.Id, InbredSet.InbredSetCode, Publication.PubMed_ID,
- Phenotype.Pre_publication_description, Phenotype.Post_publication_description, Phenotype.Original_description,
- Phenotype.Pre_publication_abbreviation, Phenotype.Post_publication_abbreviation, PublishXRef.mean,
+ CAST(Phenotype.Pre_publication_description AS BINARY),
+ CAST(Phenotype.Post_publication_description AS BINARY),
+ CAST(Phenotype.Original_description AS BINARY),
+ CAST(Phenotype.Pre_publication_abbreviation AS BINARY),
+ CAST(Phenotype.Post_publication_abbreviation AS BINARY), PublishXRef.mean,
Phenotype.Lab_code, Phenotype.Submitter, Phenotype.Owner, Phenotype.Authorized_Users,
- Publication.Authors, Publication.Title, Publication.Abstract,
- Publication.Journal, Publication.Volume, Publication.Pages,
+ CAST(Publication.Authors AS BINARY), CAST(Publication.Title AS BINARY), CAST(Publication.Abstract AS BINARY),
+ CAST(Publication.Journal AS BINARY), Publication.Volume, Publication.Pages,
Publication.Month, Publication.Year, PublishXRef.Sequence,
Phenotype.Units, PublishXRef.comments
FROM
@@ -462,9 +465,6 @@ def retrieve_trait_info(trait, dataset, get_qtl_info=False):
trait.haveinfo = True
for i, field in enumerate(dataset.display_fields):
holder = trait_info[i]
- # if isinstance(trait_info[i], basestring):
- # holder = unicode(holder.strip(codecs.BOM_UTF8), 'utf-8', "ignore")
-
setattr(trait, field, holder)
if dataset.type == 'Publish':