@@ -45,12 +45,7 @@ def test_round_trip(self):
45
45
46
46
# insert dummy data
47
47
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
54
49
(0, 'src', 'sig', 'day', 'county', 20200414, '01234',
55
50
123, 1.5, 2.5, 3.5, 456, 4, 20200414, 0, 1, False,
56
51
{ Nans .NOT_MISSING } , { Nans .NOT_MISSING } , { Nans .NOT_MISSING } )
@@ -97,12 +92,7 @@ def test_round_trip(self):
97
92
98
93
# # insert dummy data
99
94
# 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
106
96
# (0, 'src', 'sig', 'day', 'county', 20200414, '01234',
107
97
# 123, 1.5, 2.5, 3.5, 456, 4, 20200414, 0, 1, False,
108
98
# {Nans.NOT_MISSING}, {Nans.NOT_MISSING}, {Nans.NOT_MISSING})
@@ -139,12 +129,7 @@ def test_csv_format(self):
139
129
140
130
# insert dummy data
141
131
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
148
133
(0, 'src', 'sig', 'day', 'county', 20200414, '01234',
149
134
123, 1.5, 2.5, 3.5, 456, 4, 20200414, 0, 1, False,
150
135
{ Nans .NOT_MISSING } , { Nans .NOT_MISSING } , { Nans .NOT_MISSING } )
@@ -178,12 +163,7 @@ def test_raw_json_format(self):
178
163
179
164
# insert dummy data
180
165
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
187
167
(0, 'src', 'sig', 'day', 'county', 20200414, '01234',
188
168
123, 1.5, 2.5, 3.5, 456, 4, 20200414, 0, 1, False,
189
169
{ Nans .NOT_MISSING } , { Nans .NOT_MISSING } , { Nans .NOT_MISSING } )
@@ -225,12 +205,7 @@ def test_fields(self):
225
205
226
206
# insert dummy data
227
207
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
234
209
(0, 'src', 'sig', 'day', 'county', 20200414, '01234',
235
210
123, 1.5, 2.5, 3.5, 456, 4, 20200414, 0, 1, False,
236
211
{ Nans .NOT_MISSING } , { Nans .NOT_MISSING } , { Nans .NOT_MISSING } )
@@ -351,12 +326,7 @@ def test_location_wildcard(self):
351
326
352
327
# insert dummy data
353
328
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
360
330
(0, 'src', 'sig', 'day', 'county', 20200414, '11111',
361
331
123, 10, 11, 12, 456, 13, 20200414, 0, 1, False,
362
332
{ Nans .NOT_MISSING } , { Nans .NOT_MISSING } , { Nans .NOT_MISSING } ),
@@ -444,12 +414,7 @@ def test_geo_value(self):
444
414
445
415
# insert dummy data
446
416
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
453
418
(0, 'src', 'sig', 'day', 'county', 20200414, '11111',
454
419
123, 10, 11, 12, 456, 13, 20200414, 0, 1, False,
455
420
{ Nans .NOT_MISSING } , { Nans .NOT_MISSING } , { Nans .NOT_MISSING } ),
@@ -565,12 +530,7 @@ def test_location_timeline(self):
565
530
566
531
# insert dummy data
567
532
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
574
534
(0, 'src', 'sig', 'day', 'county', 20200411, '01234',
575
535
123, 10, 11, 12, 456, 13, 20200413, 2, 1, False,
576
536
{ Nans .NOT_MISSING } , { Nans .NOT_MISSING } , { Nans .NOT_MISSING } ),
@@ -658,12 +618,7 @@ def test_unique_key_constraint(self):
658
618
659
619
# insert dummy data
660
620
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
667
622
(0, 'src', 'sig', 'day', 'county', 20200414, '01234',
668
623
0, 0, 0, 0, 0, 0, 20200414, 0, 1, False,
669
624
{ Nans .NOT_MISSING } , { Nans .NOT_MISSING } , { Nans .NOT_MISSING } )
@@ -673,25 +628,15 @@ def test_unique_key_constraint(self):
673
628
# fail to insert different dummy data under the same key
674
629
with self .assertRaises (mysql .connector .errors .IntegrityError ):
675
630
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
682
632
(0, 'src', 'sig', 'day', 'county', 20200414, '01234',
683
633
1, 1, 1, 1, 1, 1, 20200414, 0, 1, False,
684
634
{ Nans .NOT_MISSING } , { Nans .NOT_MISSING } , { Nans .NOT_MISSING } )
685
635
''' )
686
636
687
637
# succeed to insert different dummy data under a different issue
688
638
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
695
640
(0, 'src', 'sig', 'day', 'county', 20200414, '01234',
696
641
1, 1, 1, 1, 1, 1, 20200415, 1, 1, False,
697
642
{ Nans .NOT_MISSING } , { Nans .NOT_MISSING } , { Nans .NOT_MISSING } )
@@ -702,12 +647,7 @@ def test_nullable_columns(self):
702
647
703
648
# insert dummy data
704
649
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
711
651
(0, 'src', 'sig', 'day', 'county', 20200414, '01234',
712
652
123, 0.123, NULL, NULL, 456, NULL, 20200414, 0, 1, False,
713
653
{ Nans .NOT_MISSING } , { Nans .OTHER } , { Nans .OTHER } )
@@ -753,12 +693,7 @@ def test_temporal_partitioning(self):
753
693
754
694
# insert dummy data
755
695
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
762
697
(0, 'src', 'sig', 'hour', 'state', 2020041714, 'vi',
763
698
123, 10, 11, 12, 456, 13, 2020041714, 0, 1, False,
764
699
{ Nans .NOT_MISSING } , { Nans .NOT_MISSING } , { Nans .NOT_MISSING } ),
@@ -815,12 +750,7 @@ def test_date_formats(self):
815
750
816
751
# insert dummy data
817
752
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
824
754
(0, 'src', 'sig', 'day', 'county', 20200411, '01234',
825
755
123, 10, 11, 12, 456, 13, 20200413, 0, 1, False,
826
756
{ Nans .NOT_MISSING } , { Nans .NOT_MISSING } , { Nans .NOT_MISSING } ),
0 commit comments