diff --git a/qiita_db/meta_util.py b/qiita_db/meta_util.py index 2ba7b4d9b..545d65910 100644 --- a/qiita_db/meta_util.py +++ b/qiita_db/meta_util.py @@ -189,7 +189,10 @@ def get_lat_longs(): AND SPLIT_PART(table_name, '_', 2)::int IN %s;""" TRN.add(sql, [tuple(portal_table_ids)]) - sql = "SELECT latitude, longitude FROM qiita.{0}" + sql = """SELECT latitude, longitude + FROM qiita.{0} + WHERE latitude IS NOT NULL + AND longitude IS NOT NULL""" idx = TRN.index portal_tables = TRN.execute_fetchflatten() diff --git a/qiita_db/support_files/populate_test_db.sql b/qiita_db/support_files/populate_test_db.sql index 51bbf59d0..0814c8a5b 100644 --- a/qiita_db/support_files/populate_test_db.sql +++ b/qiita_db/support_files/populate_test_db.sql @@ -168,8 +168,8 @@ INSERT INTO qiita.sample_1 (sample_id, season_environment, assigned_from_geo, te ('1.SKM8.640201', 'winter', 'n', '63.1 sand, 17.7 silt, 19.2 clay', '1118232', 0.15, '3483', 'root metagenome', 0.101, 114, 15, 1.3, 7.44, 0, 'ENVO:Temperate grasslands, savannas, and shrubland biome', 'GAZ:United States of America', 6.82, 'SKM8', 3.31, 'Bucu Roots', 'ENVO:plant-associated habitat', 'ANL', TRUE, TRUE, 'ENVO:soil', '2011-11-11 13:00', '1001:D8', 'Cannabis Soil Microbiome', 3.21190859967, 26.8138925876, '1118232'), ('1.SKB8.640193', 'winter', 'n', '64.6 sand, 17.6 silt, 17.8 clay', '1118232', 0.15, '3483', 'root metagenome', 0.164, 114, 15, 1.41, 7.15, 0, 'ENVO:Temperate grasslands, savannas, and shrubland biome', 'GAZ:United States of America', 6.94, 'SKB8', 5, 'Burmese root', 'ENVO:plant-associated habitat', 'ANL', TRUE, TRUE, 'ENVO:soil', '2011-11-11 13:00', '1001:M7', 'Cannabis Soil Microbiome', 74.0894932572, 65.3283470202, '1118232'), ('1.SKD2.640178', 'winter', 'n', '66 sand, 16.3 silt, 17.7 clay', '410658', 0.15, '3483', 'soil metagenome', 0.178, 114, 15, 1.51, 7.1, 0, 'ENVO:Temperate grasslands, savannas, and shrubland biome', 'GAZ:United States of America', 6.8, 'SKD2', 4.32, 'Diesel bulk', 'ENVO:plant-associated habitat', 'ANL', TRUE, TRUE, 'ENVO:soil', '2011-11-11 13:00', '1001:B5', 'Cannabis Soil Microbiome', 53.5050692395, 31.6056761814, '1118232'), - ('1.SKM3.640197', 'winter', 'n', '63.1 sand, 17.7 silt, 19.2 clay', '410658', 0.15, '3483', 'soil metagenome', 0.101, 114, 15, 1.3, 7.44, 0, 'ENVO:Temperate grasslands, savannas, and shrubland biome', 'GAZ:United States of America', 6.82, 'SKM3', 3.31, 'Bucu bulk', 'ENVO:plant-associated habitat', 'ANL', TRUE, TRUE, 'ENVO:soil', '2011-11-11 13:00', '1001:B7', 'Cannabis Soil Microbiome', 63.6505562766, 31.2003474585, '1118232'), - ('1.SKM4.640180', 'winter', 'n', '63.1 sand, 17.7 silt, 19.2 clay', '939928', 0.15, '3483', 'rhizosphere metagenome', 0.101, 114, 15, 1.3, 7.44, 0, 'ENVO:Temperate grasslands, savannas, and shrubland biome', 'GAZ:United States of America', 6.82, 'SKM4', 3.31, 'Bucu Rhizo', 'ENVO:plant-associated habitat', 'ANL', TRUE, TRUE, 'ENVO:soil', '2011-11-11 13:00', '1001:D2', 'Cannabis Soil Microbiome', 31.7167821863, 95.5088566087, '1118232'), + ('1.SKM3.640197', 'winter', 'n', '63.1 sand, 17.7 silt, 19.2 clay', '410658', 0.15, '3483', 'soil metagenome', 0.101, 114, 15, 1.3, 7.44, 0, 'ENVO:Temperate grasslands, savannas, and shrubland biome', 'GAZ:United States of America', 6.82, 'SKM3', 3.31, 'Bucu bulk', 'ENVO:plant-associated habitat', 'ANL', TRUE, TRUE, 'ENVO:soil', '2011-11-11 13:00', '1001:B7', 'Cannabis Soil Microbiome', NULL, 31.2003474585, '1118232'), + ('1.SKM4.640180', 'winter', 'n', '63.1 sand, 17.7 silt, 19.2 clay', '939928', 0.15, '3483', 'rhizosphere metagenome', 0.101, 114, 15, 1.3, 7.44, 0, 'ENVO:Temperate grasslands, savannas, and shrubland biome', 'GAZ:United States of America', 6.82, 'SKM4', 3.31, 'Bucu Rhizo', 'ENVO:plant-associated habitat', 'ANL', TRUE, TRUE, 'ENVO:soil', '2011-11-11 13:00', '1001:D2', 'Cannabis Soil Microbiome', NULL, NULL, '1118232'), ('1.SKB9.640200', 'winter', 'n', '64.6 sand, 17.6 silt, 17.8 clay', '1118232', 0.15, '3483', 'root metagenome', 0.164, 114, 15, 1.41, 7.15, 0, 'ENVO:Temperate grasslands, savannas, and shrubland biome', 'GAZ:United States of America', 6.8, 'SKB9', 5, 'Burmese root', 'ENVO:plant-associated habitat', 'ANL', TRUE, TRUE, 'ENVO:soil', '2011-11-11 13:00', '1001:B3', 'Cannabis Soil Microbiome', 12.6245524972, 96.0693176066, '1118232'), ('1.SKB4.640189', 'winter', 'n', '64.6 sand, 17.6 silt, 17.8 clay', '939928', 0.15, '3483', 'rhizosphere metagenome', 0.164, 114, 15, 1.41, 7.15, 0, 'ENVO:Temperate grasslands, savannas, and shrubland biome', 'GAZ:United States of America', 6.94, 'SKB4', 5, 'Burmese Rhizo', 'ENVO:plant-associated habitat', 'ANL', TRUE, TRUE, 'ENVO:soil', '2011-11-11 13:00', '1001:D7', 'Cannabis Soil Microbiome', 43.9614715197, 82.8516734159, '1118232'), ('1.SKB5.640181', 'winter', 'n', '64.6 sand, 17.6 silt, 17.8 clay', '939928', 0.15, '3483', 'rhizosphere metagenome', 0.164, 114, 15, 1.41, 7.15, 0, 'ENVO:Temperate grasslands, savannas, and shrubland biome', 'GAZ:United States of America', 6.94, 'SKB5', 5, 'Burmese Rhizo', 'ENVO:plant-associated habitat', 'ANL', TRUE, TRUE, 'ENVO:soil', '2011-11-11 13:00', '1001:M4', 'Cannabis Soil Microbiome', 10.6655599093, 70.784770579, '1118232'), diff --git a/qiita_db/test/test_meta_util.py b/qiita_db/test/test_meta_util.py index 5d449babb..46564f9b9 100644 --- a/qiita_db/test/test_meta_util.py +++ b/qiita_db/test/test_meta_util.py @@ -107,7 +107,6 @@ def test_get_lat_longs(self): [57.571893782, 32.5563076447], [13.089194595, 92.5274472082], [12.7065957714, 84.9722975792], - [31.7167821863, 95.5088566087], [44.9725384282, 66.1920014699], [10.6655599093, 70.784770579], [29.1499460692, 82.1270418227], @@ -121,7 +120,6 @@ def test_get_lat_longs(self): [82.8302905615, 86.3615778099], [12.6245524972, 96.0693176066], [85.4121476399, 15.6526750776], - [63.6505562766, 31.2003474585], [23.1218032799, 42.838497795], [43.9614715197, 82.8516734159], [68.51099627, 2.35063674718], diff --git a/qiita_ware/test/test_util.py b/qiita_ware/test/test_util.py index b9dcf4ffa..d6a2b9884 100644 --- a/qiita_ware/test/test_util.py +++ b/qiita_ware/test/test_util.py @@ -80,7 +80,7 @@ def test_per_sample_sequences_complex(self): def test_stats_from_df(self): obs = stats_from_df(SampleTemplate(1).to_dataframe()) for k in obs: - self.assertEqual(obs[k], SUMMARY_STATS[k]) + self.assertItemsEqual(obs[k], SUMMARY_STATS[k]) def test_dataframe_from_template(self): template = PrepTemplate(1) @@ -327,7 +327,6 @@ def test_hdf5IO_open(self): ('13.089194595', 1), ('23.1218032799', 1), ('29.1499460692', 1), - ('31.7167821863', 1), ('35.2374368957', 1), ('38.2627021402', 1), ('40.8623799474', 1), @@ -336,7 +335,6 @@ def test_hdf5IO_open(self): ('53.5050692395', 1), ('57.571893782', 1), ('60.1102854322', 1), - ('63.6505562766', 1), ('68.0991287718', 1), ('68.51099627', 1), ('74.0894932572', 1), @@ -392,7 +390,6 @@ def test_hdf5IO_open(self): ('84.9722975792', 1), ('86.3615778099', 1), ('92.5274472082', 1), - ('95.5088566087', 1), ('96.0693176066', 1)], 'pcr_primers': [('FWD:GTGCCAGCMGCCGCGGTAA; REV:GGACTACHVGGGTWTCTAAT', 27)], 'ph': [('6.8', 9), ('6.82', 10), ('6.94', 8)],