Skip to content

Listing tags #2092

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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