anvio_db.db.create_table(table_name, table_structure, table_types)
except:
if not append_mode:
raise ConfigError("Table already exists")
db_entries = [tuple([item] + [data_dict[item][h] for h in table_structure[1:]]) for item in data_dict]
anvio_db.db._exec_many("""INSERT INTO %s VALUES (%s)""" % (table_name, ",".join(["?"] * len(table_structure))), db_entries)
After Change
if not append_mode:
raise ConfigError("Something bad happened when anvi"o was trying to create table `%s` in database\
"%s". Here is how the part of the code that was about this described the\
problem: "%s"." % (table_name, self.db_path, str(e)))
db_entries = [tuple([item] + [data_dict[item][h] for h in table_structure[1:]]) for item in data_dict]
anvio_db.db._exec_many("""INSERT INTO %s VALUES (%s)""" % (table_name, ",".join(["?"] * len(table_structure))), db_entries)