@@ -211,7 +211,10 @@ def test_should_properly_handle_null_integers(self, project_id):
211
211
credentials = self .credentials ,
212
212
dialect = "legacy" ,
213
213
)
214
- tm .assert_frame_equal (df , DataFrame ({"null_integer" : [None ]}))
214
+ tm .assert_frame_equal (
215
+ df ,
216
+ DataFrame ({"null_integer" : pandas .Series ([None ], dtype = "object" )}),
217
+ )
215
218
216
219
def test_should_properly_handle_valid_floats (self , project_id ):
217
220
from math import pi
@@ -772,17 +775,33 @@ def test_configuration_raises_value_error_with_multiple_config(
772
775
)
773
776
774
777
def test_timeout_configuration (self , project_id ):
775
- sql_statement = "SELECT 1"
776
- config = {"query" : {"timeoutMs" : 1 }}
777
- # Test that QueryTimeout error raises
778
- with pytest .raises (gbq .QueryTimeout ):
779
- gbq .read_gbq (
780
- sql_statement ,
781
- project_id = project_id ,
782
- credentials = self .credentials ,
783
- configuration = config ,
784
- dialect = "legacy" ,
785
- )
778
+ sql_statement = """
779
+ SELECT
780
+ SUM(bottles_sold) total_bottles,
781
+ UPPER(category_name) category_name,
782
+ magnitude,
783
+ liquor.zip_code zip_code
784
+ FROM `bigquery-public-data.iowa_liquor_sales.sales` liquor
785
+ JOIN `bigquery-public-data.geo_us_boundaries.zip_codes` zip_codes
786
+ ON liquor.zip_code = zip_codes.zip_code
787
+ JOIN `bigquery-public-data.noaa_historic_severe_storms.tornado_paths` tornados
788
+ ON liquor.date = tornados.storm_date
789
+ WHERE ST_INTERSECTS(tornado_path_geom, zip_code_geom)
790
+ GROUP BY category_name, magnitude, zip_code
791
+ ORDER BY magnitude ASC, total_bottles DESC
792
+ """
793
+ configs = [
794
+ {"query" : {"useQueryCache" : False , "timeoutMs" : 1 }},
795
+ {"query" : {"useQueryCache" : False }, "jobTimeoutMs" : 1 },
796
+ ]
797
+ for config in configs :
798
+ with pytest .raises (gbq .QueryTimeout ):
799
+ gbq .read_gbq (
800
+ sql_statement ,
801
+ project_id = project_id ,
802
+ credentials = self .credentials ,
803
+ configuration = config ,
804
+ )
786
805
787
806
def test_query_response_bytes (self ):
788
807
assert self .gbq_connector .sizeof_fmt (999 ) == "999.0 B"
0 commit comments