16
16
import pytest
17
17
import pytz
18
18
19
- from pandas_gbq import gbq
19
+ from pandas_gbq import exceptions , gbq
20
20
import pandas_gbq .schema
21
21
22
22
TABLE_ID = "new_test"
@@ -238,7 +238,7 @@ def test_read_gbq_raises_invalid_index_column(self, project_id):
238
238
)
239
239
240
240
def test_malformed_query (self , project_id ):
241
- with pytest .raises (gbq .GenericGBQException ):
241
+ with pytest .raises (exceptions .GenericGBQException ):
242
242
gbq .read_gbq (
243
243
"SELCET * FORM [publicdata:samples.shakespeare]" ,
244
244
project_id = project_id ,
@@ -247,7 +247,7 @@ def test_malformed_query(self, project_id):
247
247
)
248
248
249
249
def test_bad_project_id (self ):
250
- with pytest .raises (gbq .GenericGBQException ):
250
+ with pytest .raises (exceptions .GenericGBQException ):
251
251
gbq .read_gbq (
252
252
"SELCET * FROM [publicdata:samples.shakespeare]" ,
253
253
project_id = "not-my-project" ,
@@ -256,7 +256,7 @@ def test_bad_project_id(self):
256
256
)
257
257
258
258
def test_bad_table_name (self , project_id ):
259
- with pytest .raises (gbq .GenericGBQException ):
259
+ with pytest .raises (exceptions .GenericGBQException ):
260
260
gbq .read_gbq (
261
261
"SELECT * FROM [publicdata:samples.nope]" ,
262
262
project_id = project_id ,
@@ -316,7 +316,7 @@ def test_legacy_sql(self, project_id):
316
316
317
317
# Test that a legacy sql statement fails when
318
318
# setting dialect='standard'
319
- with pytest .raises (gbq .GenericGBQException ):
319
+ with pytest .raises (exceptions .GenericGBQException ):
320
320
gbq .read_gbq (
321
321
legacy_sql ,
322
322
project_id = project_id ,
@@ -341,7 +341,7 @@ def test_standard_sql(self, project_id):
341
341
342
342
# Test that a standard sql statement fails when using
343
343
# the legacy SQL dialect.
344
- with pytest .raises (gbq .GenericGBQException ):
344
+ with pytest .raises (exceptions .GenericGBQException ):
345
345
gbq .read_gbq (
346
346
standard_sql ,
347
347
project_id = project_id ,
@@ -1029,7 +1029,7 @@ def test_upload_data_with_invalid_user_schema_raises_error(self, project_id):
1029
1029
{"name" : "D" , "type" : "FLOAT" },
1030
1030
]
1031
1031
destination_table = self .destination_table + test_id
1032
- with pytest .raises (gbq .GenericGBQException ):
1032
+ with pytest .raises (exceptions .GenericGBQException ):
1033
1033
gbq .to_gbq (
1034
1034
df ,
1035
1035
destination_table ,
@@ -1047,7 +1047,7 @@ def test_upload_data_with_missing_schema_fields_raises_error(self, project_id):
1047
1047
{"name" : "C" , "type" : "FLOAT" },
1048
1048
]
1049
1049
destination_table = self .destination_table + test_id
1050
- with pytest .raises (gbq .GenericGBQException ):
1050
+ with pytest .raises (exceptions .GenericGBQException ):
1051
1051
gbq .to_gbq (
1052
1052
df ,
1053
1053
destination_table ,
0 commit comments