Skip to content

Commit 2fd68bf

Browse files
committed
list study tags
1 parent 56d8b0a commit 2fd68bf

File tree

7 files changed

+292
-652
lines changed

7 files changed

+292
-652
lines changed

qiita_db/test/test_util.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,8 @@ def test_generate_study_list(self):
960960
'ebi_study_accession': 'EBI123456-BB',
961961
'study_title': ('Identification of the Microbiomes for Cannabis '
962962
'Soils'),
963-
'number_samples_collected': 27
963+
'number_samples_collected': 27,
964+
'study_tags': None
964965
}]
965966
obs_info = qdb.util.generate_study_list([1, 2, 3, 4], False)
966967
self.assertEqual(obs_info, exp_info)

qiita_db/util.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1364,6 +1364,9 @@ def generate_study_list(study_ids, build_samples, public_only=False):
13641364
(SELECT array_agg(email ORDER BY email) FROM qiita.study_users
13651365
LEFT JOIN qiita.qiita_user USING (email)
13661366
WHERE study_id=qiita.study.study_id) AS shared_with_email
1367+
- all study tags
1368+
(SELECT array_agg(study_tag) FROM qiita.per_study_tags
1369+
WHERE study_id=qiita.study.study_id) AS study_tags
13671370
"""
13681371
with qdb.sql_connection.TRN:
13691372
sql = """
@@ -1429,7 +1432,9 @@ def generate_study_list(study_ids, build_samples, public_only=False):
14291432
WHERE study_id=qiita.study.study_id) AS shared_with_name,
14301433
(SELECT array_agg(email ORDER BY email) FROM qiita.study_users
14311434
LEFT JOIN qiita.qiita_user USING (email)
1432-
WHERE study_id=qiita.study.study_id) AS shared_with_email
1435+
WHERE study_id=qiita.study.study_id) AS shared_with_email,
1436+
(SELECT array_agg(study_tag) FROM qiita.per_study_tags
1437+
WHERE study_id=qiita.study.study_id) AS study_tags
14331438
FROM qiita.study
14341439
LEFT JOIN qiita.study_person ON (
14351440
study_person_id=principal_investigator_id)

0 commit comments

Comments
 (0)