Skip to content

Commit 658a5b5

Browse files
committed
Merge branch 'fix-analysis-tests' into fix-qiita-ware-tests
2 parents fa4a68b + e7cefb0 commit 658a5b5

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

qiita_db/analysis.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929
from qiita_core.exceptions import IncompetentQiitaDeveloperError
3030
from .sql_connection import SQLConnectionHandler
3131
from .base import QiitaStatusObject
32-
from .data import ProcessedData, RawData
32+
from .data import ProcessedData
3333
from .study import Study
3434
from .exceptions import QiitaDBStatusError, QiitaDBError
3535
from .util import (convert_to_id, get_work_base_dir,
36-
get_mountpoint, get_table_cols, insert_filepaths)
36+
get_mountpoint, insert_filepaths)
3737

3838

3939
class Analysis(QiitaStatusObject):

qiita_db/support_files/patches/23.sql

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,10 @@ LOOP
4949

5050
-- Copy the values from the required_sample_info table to the dynamic table
5151
EXECUTE '
52-
WITH sample_values AS (SELECT *
53-
FROM qiita.required_sample_info
54-
JOIN qiita.required_sample_info_status
55-
USING (required_sample_info_status_id)
56-
WHERE study_id = ' || st_id || ')
52+
WITH sv AS (SELECT * FROM qiita.required_sample_info
53+
JOIN qiita.required_sample_info_status
54+
USING (required_sample_info_status_id)
55+
WHERE study_id = ' || st_id || ')
5756
UPDATE ' || dyn_table || '
5857
SET physical_specimen_location=sv.physical_location,
5958
physical_specimen_remaining=sv.has_physical_specimen,
@@ -65,7 +64,7 @@ LOOP
6564
latitude=sv.latitude,
6665
longitude=sv.longitude,
6766
required_sample_info_status=sv.status
68-
FROM sample_values sv
67+
FROM sv
6968
WHERE ' || dyn_table || '.sample_id = sv.sample_id;';
7069

7170
END LOOP;
@@ -125,15 +124,14 @@ LOOP
125124

126125
-- Copy the values from the common_prep_info table to the dynamic table
127126
EXECUTE '
128-
WITH sample_values AS (SELECT *
129-
FROM qiita.common_prep_info
130-
JOIN qiita.emp_status USING (emp_status_id)
131-
WHERE prep_template_id = ' || prep_id || ')
127+
WITH sv AS (SELECT * FROM qiita.common_prep_info
128+
JOIN qiita.emp_status USING (emp_status_id)
129+
WHERE prep_template_id = ' || prep_id || ')
132130
UPDATE ' || dyn_table || '
133131
SET center_name=sv.center_name,
134132
center_project_name=sv.center_project_name,
135133
emp_status=sv.emp_status
136-
FROM sample_values sv
134+
FROM sv
137135
WHERE ' || dyn_table || '.sample_id=sv.sample_id;';
138136

139137
END LOOP;

qiita_db/support_files/patches/python_patches/23.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Need to re-generate the files, given that some headers have changed
33

44
from qiita_db.sql_connection import SQLConnectionHandler
5+
from qiita_db.metadata_template import SampleTemplate, PrepTemplate
56

67
conn_handler = SQLConnectionHandler()
78

0 commit comments

Comments
 (0)