Skip to content

Commit

Permalink
Merge fdb6723 into d3555ac
Browse files Browse the repository at this point in the history
  • Loading branch information
antgonza committed Mar 27, 2017
2 parents d3555ac + fdb6723 commit 8ff13ec
Show file tree
Hide file tree
Showing 8 changed files with 308 additions and 654 deletions.
3 changes: 2 additions & 1 deletion qiita_db/test/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,8 @@ def test_generate_study_list(self):
'ebi_study_accession': 'EBI123456-BB',
'study_title': ('Identification of the Microbiomes for Cannabis '
'Soils'),
'number_samples_collected': 27
'number_samples_collected': 27,
'study_tags': None
}]
obs_info = qdb.util.generate_study_list([1, 2, 3, 4], False)
self.assertEqual(obs_info, exp_info)
Expand Down
7 changes: 6 additions & 1 deletion qiita_db/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -1364,6 +1364,9 @@ def generate_study_list(study_ids, build_samples, public_only=False):
(SELECT array_agg(email ORDER BY email) FROM qiita.study_users
LEFT JOIN qiita.qiita_user USING (email)
WHERE study_id=qiita.study.study_id) AS shared_with_email
- all study tags
(SELECT array_agg(study_tag) FROM qiita.per_study_tags
WHERE study_id=qiita.study.study_id) AS study_tags
"""
with qdb.sql_connection.TRN:
sql = """
Expand Down Expand Up @@ -1429,7 +1432,9 @@ def generate_study_list(study_ids, build_samples, public_only=False):
WHERE study_id=qiita.study.study_id) AS shared_with_name,
(SELECT array_agg(email ORDER BY email) FROM qiita.study_users
LEFT JOIN qiita.qiita_user USING (email)
WHERE study_id=qiita.study.study_id) AS shared_with_email
WHERE study_id=qiita.study.study_id) AS shared_with_email,
(SELECT array_agg(study_tag) FROM qiita.per_study_tags
WHERE study_id=qiita.study.study_id) AS study_tags
FROM qiita.study
LEFT JOIN qiita.study_person ON (
study_person_id=principal_investigator_id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def setUp(self):
'publication_doi': ['10.100/123456', '10.100/7891011'],
'publication_pid': ['123456', '7891011'],
'pi': ('PI_dude@foo.bar', 'PIDude'),
'study_tags': None,
'proc_data_info': PROC_DATA_INFO
}
self.exp = [self.single_exp]
Expand Down Expand Up @@ -124,6 +125,7 @@ def test_build_study_info_empty_study(self):
'study_id': 2,
'ebi_study_accession': None,
'study_title': 'My study',
'study_tags': None,
'number_samples_collected': 0})

self.assertItemsEqual(obs, self.exp)
Expand Down Expand Up @@ -280,7 +282,8 @@ def setUp(self):
'Future studies will attempt to analyze the soils and '
'rhizospheres from the same location at different time '
'points in the plant lifecycle.'),
'number_samples_collected': 27}],
'number_samples_collected': 27,
'study_tags': None}],
'sEcho': 1021,
'iTotalDisplayRecords': 1}
self.empty = {'aaData': [],
Expand Down
Loading

0 comments on commit 8ff13ec

Please sign in to comment.