Skip to content

Commit b7e9c29

Browse files
authored
Merge pull request #583 from cmu-delphi/revert-574-dev
Revert "add minimum issue date to the metadata with some tests(merge to dev)"
2 parents 2136bf9 + 0cca7aa commit b7e9c29

File tree

9 files changed

+28
-179
lines changed

9 files changed

+28
-179
lines changed

integrations/acquisition/covidcast/test_covidcast_meta_caching.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -67,24 +67,14 @@ def test_caching(self):
6767

6868
# insert dummy data
6969
self.cur.execute(f'''
70-
INSERT INTO
71-
`covidcast` (`id`, `source`, `signal`, `time_type`,
72-
`geo_type`, `time_value`, `geo_value`, `value_updated_timestamp`,
73-
`value`, `stderr`, `sample_size`, `direction_updated_timestamp`,
74-
`direction`, `issue`, `lag`, `is_latest_issue`, `is_wip`)
75-
VALUES
70+
insert into covidcast values
7671
(0, 'src', 'sig', 'day', 'state', 20200422, 'pa',
7772
123, 1, 2, 3, 456, 1, 20200422, 0, 1, False, {Nans.NOT_MISSING}, {Nans.NOT_MISSING}, {Nans.NOT_MISSING}),
7873
(0, 'src', 'sig', 'day', 'state', 20200422, 'wa',
7974
789, 1, 2, 3, 456, 1, 20200423, 1, 1, False, {Nans.NOT_MISSING}, {Nans.NOT_MISSING}, {Nans.NOT_MISSING})
8075
''')
8176
self.cur.execute(f'''
82-
INSERT INTO
83-
`covidcast` (`id`, `source`, `signal`, `time_type`,
84-
`geo_type`, `time_value`, `geo_value`, `value_updated_timestamp`,
85-
`value`, `stderr`, `sample_size`, `direction_updated_timestamp`,
86-
`direction`, `issue`, `lag`, `is_latest_issue`, `is_wip`)
87-
VALUES
77+
insert into covidcast values
8878
(100, 'src', 'wip_sig', 'day', 'state', 20200422, 'pa',
8979
456, 4, 5, 6, 789, -1, 20200422, 0, 1, True, {Nans.NOT_MISSING}, {Nans.NOT_MISSING}, {Nans.NOT_MISSING})
9080
''')
@@ -112,7 +102,6 @@ def test_caching(self):
112102
'mean_value': 1,
113103
'stdev_value': 0,
114104
'max_issue': 20200423,
115-
'min_issue': 20200422,
116105
'min_lag': 0,
117106
'max_lag': 1,
118107
}

integrations/acquisition/covidcast/test_fill_is_latest_issue.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,7 @@ def _test_fill_is_latest_issue(self, clbp, use_filter):
5858
# direction, issue, lag, is_latest_issue, is_wip, missing_value, missing_stderr, missing_sample_size)
5959

6060
self.cur.execute(f'''
61-
INSERT INTO
62-
`covidcast` (`id`, `source`, `signal`, `time_type`,
63-
`geo_type`, `time_value`, `geo_value`, `value_updated_timestamp`,
64-
`value`, `stderr`, `sample_size`, `direction_updated_timestamp`,
65-
`direction`, `issue`, `lag`, `is_latest_issue`, `is_wip`)
66-
VALUES
61+
insert into covidcast values
6762
(0, 'src', 'sig', 'day', 'state', 20200228, 'ca',
6863
123, 2, 5, 5, 5, NULL, 20200228, 0, 1, False,
6964
{Nans.NOT_MISSING}, {Nans.NOT_MISSING}, {Nans.NOT_MISSING}),

integrations/client/test_delphi_epidata.py

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,7 @@ def test_covidcast(self):
6767

6868
# insert dummy data
6969
self.cur.execute(f'''
70-
INSERT INTO
71-
`covidcast` (`id`, `source`, `signal`, `time_type`,
72-
`geo_type`, `time_value`, `geo_value`, `value_updated_timestamp`,
73-
`value`, `stderr`, `sample_size`, `direction_updated_timestamp`,
74-
`direction`, `issue`, `lag`, `is_latest_issue`, `is_wip`)
75-
VALUES
70+
insert into covidcast values
7671
(0, 'src', 'sig', 'day', 'county', 20200414, '01234',
7772
123, 1.5, 2.5, 3.5, 456, 4, 20200414, 0, 0, False,
7873
{Nans.NOT_MISSING}, {Nans.NOT_MISSING}, {Nans.NOT_MISSING}),
@@ -336,12 +331,7 @@ def test_geo_value(self):
336331

337332
# insert dummy data
338333
self.cur.execute(f'''
339-
INSERT INTO
340-
`covidcast` (`id`, `source`, `signal`, `time_type`,
341-
`geo_type`, `time_value`, `geo_value`, `value_updated_timestamp`,
342-
`value`, `stderr`, `sample_size`, `direction_updated_timestamp`,
343-
`direction`, `issue`, `lag`, `is_latest_issue`, `is_wip`)
344-
VALUES
334+
insert into covidcast values
345335
(0, 'src', 'sig', 'day', 'county', 20200414, '11111',
346336
123, 10, 11, 12, 456, 13, 20200414, 0, 1, False,
347337
{Nans.NOT_MISSING}, {Nans.NOT_MISSING}, {Nans.NOT_MISSING}),
@@ -442,12 +432,7 @@ def test_covidcast_meta(self):
442432

443433
# insert dummy data
444434
self.cur.execute(f'''
445-
INSERT INTO
446-
`covidcast` (`id`, `source`, `signal`, `time_type`,
447-
`geo_type`, `time_value`, `geo_value`, `value_updated_timestamp`,
448-
`value`, `stderr`, `sample_size`, `direction_updated_timestamp`,
449-
`direction`, `issue`, `lag`, `is_latest_issue`, `is_wip`)
450-
VALUES
435+
insert into covidcast values
451436
(0, 'src', 'sig', 'day', 'county', 20200414, '01234',
452437
123, 1.5, 2.5, 3.5, 456, 4, 20200414, 0, 0, False,
453438
{Nans.NOT_MISSING}, {Nans.NOT_MISSING}, {Nans.NOT_MISSING}),
@@ -577,12 +562,7 @@ def test_covidcast_nowcast(self):
577562
def test_async_epidata(self):
578563
# insert dummy data
579564
self.cur.execute(f'''
580-
INSERT INTO
581-
`covidcast` (`id`, `source`, `signal`, `time_type`,
582-
`geo_type`, `time_value`, `geo_value`, `value_updated_timestamp`,
583-
`value`, `stderr`, `sample_size`, `direction_updated_timestamp`,
584-
`direction`, `issue`, `lag`, `is_latest_issue`, `is_wip`)
585-
VALUES
565+
insert into covidcast values
586566
(0, 'src', 'sig', 'day', 'county', 20200414, '11111',
587567
123, 10, 11, 12, 456, 13, 20200414, 0, 1, False,
588568
{Nans.NOT_MISSING}, {Nans.NOT_MISSING}, {Nans.NOT_MISSING}),

integrations/server/test_covidcast.py

Lines changed: 14 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,7 @@ def test_round_trip(self):
4545

4646
# insert dummy data
4747
self.cur.execute(f'''
48-
INSERT INTO
49-
`covidcast` (`id`, `source`, `signal`, `time_type`,
50-
`geo_type`, `time_value`, `geo_value`, `value_updated_timestamp`,
51-
`value`, `stderr`, `sample_size`, `direction_updated_timestamp`,
52-
`direction`, `issue`, `lag`, `is_latest_issue`, `is_wip`)
53-
VALUES
48+
insert into covidcast values
5449
(0, 'src', 'sig', 'day', 'county', 20200414, '01234',
5550
123, 1.5, 2.5, 3.5, 456, 4, 20200414, 0, 1, False,
5651
{Nans.NOT_MISSING}, {Nans.NOT_MISSING}, {Nans.NOT_MISSING})
@@ -97,12 +92,7 @@ def test_round_trip(self):
9792

9893
# # insert dummy data
9994
# self.cur.execute(f'''
100-
# INSERT INTO
101-
# `covidcast` (`id`, `source`, `signal`, `time_type`,
102-
# `geo_type`, `time_value`, `geo_value`, `value_updated_timestamp`,
103-
# `value`, `stderr`, `sample_size`, `direction_updated_timestamp`,
104-
# `direction`, `issue`, `lag`, `is_latest_issue`, `is_wip`)
105-
# VALUES
95+
# insert into covidcast values
10696
# (0, 'src', 'sig', 'day', 'county', 20200414, '01234',
10797
# 123, 1.5, 2.5, 3.5, 456, 4, 20200414, 0, 1, False,
10898
# {Nans.NOT_MISSING}, {Nans.NOT_MISSING}, {Nans.NOT_MISSING})
@@ -139,12 +129,7 @@ def test_csv_format(self):
139129

140130
# insert dummy data
141131
self.cur.execute(f'''
142-
INSERT INTO
143-
`covidcast` (`id`, `source`, `signal`, `time_type`,
144-
`geo_type`, `time_value`, `geo_value`, `value_updated_timestamp`,
145-
`value`, `stderr`, `sample_size`, `direction_updated_timestamp`,
146-
`direction`, `issue`, `lag`, `is_latest_issue`, `is_wip`)
147-
VALUES
132+
insert into covidcast values
148133
(0, 'src', 'sig', 'day', 'county', 20200414, '01234',
149134
123, 1.5, 2.5, 3.5, 456, 4, 20200414, 0, 1, False,
150135
{Nans.NOT_MISSING}, {Nans.NOT_MISSING}, {Nans.NOT_MISSING})
@@ -178,12 +163,7 @@ def test_raw_json_format(self):
178163

179164
# insert dummy data
180165
self.cur.execute(f'''
181-
INSERT INTO
182-
`covidcast` (`id`, `source`, `signal`, `time_type`,
183-
`geo_type`, `time_value`, `geo_value`, `value_updated_timestamp`,
184-
`value`, `stderr`, `sample_size`, `direction_updated_timestamp`,
185-
`direction`, `issue`, `lag`, `is_latest_issue`, `is_wip`)
186-
VALUES
166+
insert into covidcast values
187167
(0, 'src', 'sig', 'day', 'county', 20200414, '01234',
188168
123, 1.5, 2.5, 3.5, 456, 4, 20200414, 0, 1, False,
189169
{Nans.NOT_MISSING}, {Nans.NOT_MISSING}, {Nans.NOT_MISSING})
@@ -225,12 +205,7 @@ def test_fields(self):
225205

226206
# insert dummy data
227207
self.cur.execute(f'''
228-
INSERT INTO
229-
`covidcast` (`id`, `source`, `signal`, `time_type`,
230-
`geo_type`, `time_value`, `geo_value`, `value_updated_timestamp`,
231-
`value`, `stderr`, `sample_size`, `direction_updated_timestamp`,
232-
`direction`, `issue`, `lag`, `is_latest_issue`, `is_wip`)
233-
VALUES
208+
insert into covidcast values
234209
(0, 'src', 'sig', 'day', 'county', 20200414, '01234',
235210
123, 1.5, 2.5, 3.5, 456, 4, 20200414, 0, 1, False,
236211
{Nans.NOT_MISSING}, {Nans.NOT_MISSING}, {Nans.NOT_MISSING})
@@ -351,12 +326,7 @@ def test_location_wildcard(self):
351326

352327
# insert dummy data
353328
self.cur.execute(f'''
354-
INSERT INTO
355-
`covidcast` (`id`, `source`, `signal`, `time_type`,
356-
`geo_type`, `time_value`, `geo_value`, `value_updated_timestamp`,
357-
`value`, `stderr`, `sample_size`, `direction_updated_timestamp`,
358-
`direction`, `issue`, `lag`, `is_latest_issue`, `is_wip`)
359-
VALUES
329+
insert into covidcast values
360330
(0, 'src', 'sig', 'day', 'county', 20200414, '11111',
361331
123, 10, 11, 12, 456, 13, 20200414, 0, 1, False,
362332
{Nans.NOT_MISSING}, {Nans.NOT_MISSING}, {Nans.NOT_MISSING}),
@@ -444,12 +414,7 @@ def test_geo_value(self):
444414

445415
# insert dummy data
446416
self.cur.execute(f'''
447-
INSERT INTO
448-
`covidcast` (`id`, `source`, `signal`, `time_type`,
449-
`geo_type`, `time_value`, `geo_value`, `value_updated_timestamp`,
450-
`value`, `stderr`, `sample_size`, `direction_updated_timestamp`,
451-
`direction`, `issue`, `lag`, `is_latest_issue`, `is_wip`)
452-
VALUES
417+
insert into covidcast values
453418
(0, 'src', 'sig', 'day', 'county', 20200414, '11111',
454419
123, 10, 11, 12, 456, 13, 20200414, 0, 1, False,
455420
{Nans.NOT_MISSING}, {Nans.NOT_MISSING}, {Nans.NOT_MISSING}),
@@ -565,12 +530,7 @@ def test_location_timeline(self):
565530

566531
# insert dummy data
567532
self.cur.execute(f'''
568-
INSERT INTO
569-
`covidcast` (`id`, `source`, `signal`, `time_type`,
570-
`geo_type`, `time_value`, `geo_value`, `value_updated_timestamp`,
571-
`value`, `stderr`, `sample_size`, `direction_updated_timestamp`,
572-
`direction`, `issue`, `lag`, `is_latest_issue`, `is_wip`)
573-
VALUES
533+
insert into covidcast values
574534
(0, 'src', 'sig', 'day', 'county', 20200411, '01234',
575535
123, 10, 11, 12, 456, 13, 20200413, 2, 1, False,
576536
{Nans.NOT_MISSING}, {Nans.NOT_MISSING}, {Nans.NOT_MISSING}),
@@ -658,12 +618,7 @@ def test_unique_key_constraint(self):
658618

659619
# insert dummy data
660620
self.cur.execute(f'''
661-
INSERT INTO
662-
`covidcast` (`id`, `source`, `signal`, `time_type`,
663-
`geo_type`, `time_value`, `geo_value`, `value_updated_timestamp`,
664-
`value`, `stderr`, `sample_size`, `direction_updated_timestamp`,
665-
`direction`, `issue`, `lag`, `is_latest_issue`, `is_wip`)
666-
VALUES
621+
insert into covidcast values
667622
(0, 'src', 'sig', 'day', 'county', 20200414, '01234',
668623
0, 0, 0, 0, 0, 0, 20200414, 0, 1, False,
669624
{Nans.NOT_MISSING}, {Nans.NOT_MISSING}, {Nans.NOT_MISSING})
@@ -673,25 +628,15 @@ def test_unique_key_constraint(self):
673628
# fail to insert different dummy data under the same key
674629
with self.assertRaises(mysql.connector.errors.IntegrityError):
675630
self.cur.execute(f'''
676-
INSERT INTO
677-
`covidcast` (`id`, `source`, `signal`, `time_type`,
678-
`geo_type`, `time_value`, `geo_value`, `value_updated_timestamp`,
679-
`value`, `stderr`, `sample_size`, `direction_updated_timestamp`,
680-
`direction`, `issue`, `lag`, `is_latest_issue`, `is_wip`)
681-
VALUES
631+
insert into covidcast values
682632
(0, 'src', 'sig', 'day', 'county', 20200414, '01234',
683633
1, 1, 1, 1, 1, 1, 20200414, 0, 1, False,
684634
{Nans.NOT_MISSING}, {Nans.NOT_MISSING}, {Nans.NOT_MISSING})
685635
''')
686636

687637
# succeed to insert different dummy data under a different issue
688638
self.cur.execute(f'''
689-
INSERT INTO
690-
`covidcast` (`id`, `source`, `signal`, `time_type`,
691-
`geo_type`, `time_value`, `geo_value`, `value_updated_timestamp`,
692-
`value`, `stderr`, `sample_size`, `direction_updated_timestamp`,
693-
`direction`, `issue`, `lag`, `is_latest_issue`, `is_wip`)
694-
VALUES
639+
insert into covidcast values
695640
(0, 'src', 'sig', 'day', 'county', 20200414, '01234',
696641
1, 1, 1, 1, 1, 1, 20200415, 1, 1, False,
697642
{Nans.NOT_MISSING}, {Nans.NOT_MISSING}, {Nans.NOT_MISSING})
@@ -702,12 +647,7 @@ def test_nullable_columns(self):
702647

703648
# insert dummy data
704649
self.cur.execute(f'''
705-
INSERT INTO
706-
`covidcast` (`id`, `source`, `signal`, `time_type`,
707-
`geo_type`, `time_value`, `geo_value`, `value_updated_timestamp`,
708-
`value`, `stderr`, `sample_size`, `direction_updated_timestamp`,
709-
`direction`, `issue`, `lag`, `is_latest_issue`, `is_wip`)
710-
VALUES
650+
insert into covidcast values
711651
(0, 'src', 'sig', 'day', 'county', 20200414, '01234',
712652
123, 0.123, NULL, NULL, 456, NULL, 20200414, 0, 1, False,
713653
{Nans.NOT_MISSING}, {Nans.OTHER}, {Nans.OTHER})
@@ -753,12 +693,7 @@ def test_temporal_partitioning(self):
753693

754694
# insert dummy data
755695
self.cur.execute(f'''
756-
INSERT INTO
757-
`covidcast` (`id`, `source`, `signal`, `time_type`,
758-
`geo_type`, `time_value`, `geo_value`, `value_updated_timestamp`,
759-
`value`, `stderr`, `sample_size`, `direction_updated_timestamp`,
760-
`direction`, `issue`, `lag`, `is_latest_issue`, `is_wip`)
761-
VALUES
696+
insert into covidcast values
762697
(0, 'src', 'sig', 'hour', 'state', 2020041714, 'vi',
763698
123, 10, 11, 12, 456, 13, 2020041714, 0, 1, False,
764699
{Nans.NOT_MISSING}, {Nans.NOT_MISSING}, {Nans.NOT_MISSING}),
@@ -815,12 +750,7 @@ def test_date_formats(self):
815750

816751
# insert dummy data
817752
self.cur.execute(f'''
818-
INSERT INTO
819-
`covidcast` (`id`, `source`, `signal`, `time_type`,
820-
`geo_type`, `time_value`, `geo_value`, `value_updated_timestamp`,
821-
`value`, `stderr`, `sample_size`, `direction_updated_timestamp`,
822-
`direction`, `issue`, `lag`, `is_latest_issue`, `is_wip`)
823-
VALUES
753+
insert into covidcast values
824754
(0, 'src', 'sig', 'day', 'county', 20200411, '01234',
825755
123, 10, 11, 12, 456, 13, 20200413, 0, 1, False,
826756
{Nans.NOT_MISSING}, {Nans.NOT_MISSING}, {Nans.NOT_MISSING}),

integrations/server/test_covidcast_endpoints.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,7 @@ def _insert_rows(self, rows: Iterable[CovidcastRow]):
127127
sql = ",\n".join((str(r) for r in rows))
128128
self.cur.execute(
129129
f"""
130-
INSERT INTO
131-
`covidcast` (`id`, `source`, `signal`, `time_type`,
132-
`geo_type`, `time_value`, `geo_value`, `value_updated_timestamp`,
133-
`value`, `stderr`, `sample_size`, `direction_updated_timestamp`,
134-
`direction`, `issue`, `lag`, `is_latest_issue`, `is_wip`)
135-
VALUES
130+
insert into covidcast values
136131
{sql}
137132
"""
138133
)

integrations/server/test_covidcast_meta.py

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,7 @@ def test_round_trip(self):
4747

4848
# insert dummy data and accumulate expected results (in sort order)
4949
template = '''
50-
INSERT INTO
51-
`covidcast` (`id`, `source`, `signal`, `time_type`,
52-
`geo_type`, `time_value`, `geo_value`, `value_updated_timestamp`,
53-
`value`, `stderr`, `sample_size`, `direction_updated_timestamp`,
54-
`direction`, `issue`, `lag`, `is_latest_issue`, `is_wip`)
55-
VALUES
50+
insert into covidcast values
5651
(0, "%s", "%s", "%s", "%s", %d, "%s", 123,
5752
%d, 0, 0, 456, 0, %d, 0, 1, %d, %d, %d, %d)
5853
'''
@@ -105,12 +100,7 @@ def test_filter(self):
105100

106101
# insert dummy data and accumulate expected results (in sort order)
107102
template = '''
108-
INSERT INTO
109-
`covidcast` (`id`, `source`, `signal`, `time_type`,
110-
`geo_type`, `time_value`, `geo_value`, `value_updated_timestamp`,
111-
`value`, `stderr`, `sample_size`, `direction_updated_timestamp`,
112-
`direction`, `issue`, `lag`, `is_latest_issue`, `is_wip`)
113-
VALUES
103+
insert into covidcast values
114104
(0, "%s", "%s", "%s", "%s", %d, "%s", 123,
115105
%d, 0, 0, 456, 0, %d, 0, 1, %d, %d, %d, %d)
116106
'''
@@ -228,12 +218,7 @@ def test_suppress_work_in_progress(self):
228218

229219
# insert dummy data and accumulate expected results (in sort order)
230220
template = '''
231-
INSERT INTO
232-
`covidcast` (`id`, `source`, `signal`, `time_type`,
233-
`geo_type`, `time_value`, `geo_value`, `value_updated_timestamp`,
234-
`value`, `stderr`, `sample_size`, `direction_updated_timestamp`,
235-
`direction`, `issue`, `lag`, `is_latest_issue`, `is_wip`)
236-
VALUES
221+
insert into covidcast values
237222
(0, "%s", "%s", "%s", "%s", %d, "%s", 123,
238223
%d, 0, 0, 456, 0, %d, 0, 1, %d, %d, %d, %d)
239224
'''

integrations/server/test_fluview.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,7 @@ def test_round_trip(self):
4848

4949
# insert dummy data
5050
self.cur.execute('''
51-
INSERT INTO
52-
`fluview` (`id`, `release_date`, `issue`, `epiweek`, `region`,
53-
`lag`, `num_ili`, `num_patients`, `num_providers`, `wili`, `ili`,
54-
`num_age_0`, `num_age_1`, `num_age_2`, `num_age_3`, `num_age_4`, `num_age_5`)
55-
VALUES
51+
insert into fluview values
5652
(0, "2020-04-07", 202021, 202020, "nat", 1, 2, 3, 4, 3.14159, 1.41421,
5753
10, 11, 12, 13, 14, 15)
5854
''')

integrations/server/test_fluview_meta.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,7 @@ def test_round_trip(self):
4848

4949
# insert dummy data
5050
self.cur.execute('''
51-
INSERT INTO
52-
`fluview` (`id`, `release_date`, `issue`, `epiweek`, `region`,
53-
`lag`, `num_ili`, `num_patients`, `num_providers`, `wili`, `ili`,
54-
`num_age_0`, `num_age_1`, `num_age_2`, `num_age_3`, `num_age_4`, `num_age_5`)
55-
VALUES
51+
insert into fluview values
5652
(0, "2020-04-07", 202021, 202020, "nat", 1, 2, 3, 4, 3.14159, 1.41421,
5753
10, 11, 12, 13, 14, 15),
5854
(0, "2020-04-28", 202022, 202022, "hhs1", 5, 6, 7, 8, 1.11111, 2.22222,

0 commit comments

Comments
 (0)