@@ -793,17 +793,14 @@ def _add_common_extend_steps_to_queue(self, md_template, conn_handler,
793
793
"""
794
794
# Check if we are adding new samples
795
795
sample_ids = md_template .index .tolist ()
796
- sql = """SELECT sample_id FROM qiita.{0}
797
- WHERE {1}=%s""" .format (self ._table , self ._id_column )
798
- curr_samples = set (
799
- s [0 ] for s in conn_handler .execute_fetchall (sql , (self ._id ,)))
796
+ curr_samples = set (self .keys ())
800
797
existing_samples = curr_samples .intersection (sample_ids )
801
798
new_samples = set (sample_ids ).difference (existing_samples )
802
799
803
800
# Check if we are adding new columns
804
801
table_name = self ._table_name (self ._id )
805
802
# Get the required columns from the DB
806
- db_cols = sorted ( get_table_cols (self ._table , conn_handler ) )
803
+ db_cols = get_table_cols (self ._table , conn_handler )
807
804
# Remove the sample_id and _id_column columns
808
805
db_cols .remove ('sample_id' )
809
806
db_cols .remove (self ._id_column )
@@ -837,10 +834,9 @@ def _add_common_extend_steps_to_queue(self, md_template, conn_handler,
837
834
838
835
if existing_samples :
839
836
warnings .warn (
840
- "The new columns '%s' have been added to the existing "
841
- "samples '%s'. Any other value of these samples have been "
842
- "modified." % (", " .join (new_cols ),
843
- ", " .join (existing_samples )),
837
+ "No values have been modified for samples '%s'. However, "
838
+ "the following columns have been added to them: '%s'"
839
+ % (", " .join (existing_samples ), ", " .join (new_cols )),
844
840
QiitaDBWarning )
845
841
# The values for the new columns are the only ones that get
846
842
# added to the database. None of the existing values will be
0 commit comments