@@ -358,7 +358,7 @@ def test_create_rows_then_dump_table(self):
358358# 8 tries -> 1 + 2 + 4 + 8 + 16 + 32 + 64 = 127 seconds
359359retry = RetryResult (_has_rows ,max_tries = 8 )
360360rows = retry (self ._fetch_single_page )(table )
361- row_tuples = [r .values ()for r in rows ]
361+ row_tuples = [tuple ( r .values () )for r in rows ]
362362by_age = operator .itemgetter (1 )
363363self .assertEqual (sorted (row_tuples ,key = by_age ),
364364sorted (ROWS ,key = by_age ))
@@ -396,7 +396,7 @@ def test_load_table_from_local_file_then_dump_table(self):
396396self .assertEqual (job .output_rows ,len (ROWS ))
397397
398398rows = self ._fetch_single_page (table )
399- row_tuples = [r .values ()for r in rows ]
399+ row_tuples = [tuple ( r .values () )for r in rows ]
400400by_age = operator .itemgetter (1 )
401401self .assertEqual (sorted (row_tuples ,key = by_age ),
402402sorted (ROWS ,key = by_age ))
@@ -430,7 +430,7 @@ def test_load_table_from_local_avro_file_then_dump_table(self):
430430
431431table = Config .CLIENT .get_table (table )
432432rows = self ._fetch_single_page (table )
433- row_tuples = [r .values ()for r in rows ]
433+ row_tuples = [tuple ( r .values () )for r in rows ]
434434by_wavelength = operator .itemgetter (1 )
435435self .assertEqual (sorted (row_tuples ,key = by_wavelength ),
436436sorted (ROWS ,key = by_wavelength ))
@@ -462,7 +462,7 @@ def test_load_table_from_uri_then_dump_table(self):
462462retry (job .reload )()
463463
464464rows = self ._fetch_single_page (table )
465- row_tuples = [r .values ()for r in rows ]
465+ row_tuples = [tuple ( r .values () )for r in rows ]
466466by_age = operator .itemgetter (1 )
467467self .assertEqual (sorted (row_tuples ,key = by_age ),
468468sorted (ROWS ,key = by_age ))
@@ -500,7 +500,7 @@ def test_load_table_from_uri_w_autodetect_schema_then_get_job(self):
500500self .assertEqual (table .schema , [field_name ,field_age ])
501501
502502actual_rows = self ._fetch_single_page (table )
503- actual_row_tuples = [r .values ()for r in actual_rows ]
503+ actual_row_tuples = [tuple ( r .values () )for r in actual_rows ]
504504by_age = operator .itemgetter (1 )
505505self .assertEqual (
506506sorted (actual_row_tuples ,key = by_age ),sorted (rows ,key = by_age ))
@@ -846,7 +846,7 @@ def test_dbapi_fetchall(self):
846846self .assertEqual (Config .CURSOR .rowcount ,3 ,"expected 3 rows" )
847847Config .CURSOR .arraysize = arraysize
848848rows = Config .CURSOR .fetchall ()
849- row_tuples = [r .values ()for r in rows ]
849+ row_tuples = [tuple ( r .values () )for r in rows ]
850850self .assertEqual (row_tuples , [(1 ,2 ), (3 ,4 ), (5 ,6 )])
851851
852852def _load_table_for_dml (self ,rows ,dataset_id ,table_id ):
@@ -1232,14 +1232,14 @@ def test_large_query_w_public_data(self):
12321232def test_query_future (self ):
12331233query_job = Config .CLIENT .query ('SELECT 1' )
12341234iterator = query_job .result (timeout = JOB_TIMEOUT )
1235- row_tuples = [r .values ()for r in iterator ]
1235+ row_tuples = [tuple ( r .values () )for r in iterator ]
12361236self .assertEqual (row_tuples , [(1 ,)])
12371237
12381238def test_query_iter (self ):
12391239import types
12401240query_job = Config .CLIENT .query ('SELECT 1' )
12411241self .assertIsInstance (iter (query_job ),types .GeneratorType )
1242- row_tuples = [r .values ()for r in query_job ]
1242+ row_tuples = [tuple ( r .values () )for r in query_job ]
12431243self .assertEqual (row_tuples , [(1 ,)])
12441244
12451245def test_query_table_def (self ):
@@ -1258,7 +1258,7 @@ def test_query_table_def(self):
12581258
12591259got_rows = Config .CLIENT .query_rows (sql ,job_config = job_config )
12601260
1261- row_tuples = [r .values ()for r in got_rows ]
1261+ row_tuples = [tuple ( r .values () )for r in got_rows ]
12621262by_age = operator .itemgetter (1 )
12631263self .assertEqual (sorted (row_tuples ,key = by_age ),
12641264sorted (ROWS ,key = by_age ))
@@ -1282,7 +1282,7 @@ def test_query_external_table(self):
12821282
12831283got_rows = Config .CLIENT .query_rows (sql )
12841284
1285- row_tuples = [r .values ()for r in got_rows ]
1285+ row_tuples = [tuple ( r .values () )for r in got_rows ]
12861286by_age = operator .itemgetter (1 )
12871287self .assertEqual (sorted (row_tuples ,key = by_age ),
12881288sorted (ROWS ,key = by_age ))
@@ -1318,7 +1318,7 @@ def test_create_rows_nested_nested(self):
13181318
13191319retry = RetryResult (_has_rows ,max_tries = 8 )
13201320rows = retry (self ._fetch_single_page )(table )
1321- row_tuples = [r .values ()for r in rows ]
1321+ row_tuples = [tuple ( r .values () )for r in rows ]
13221322self .assertEqual (row_tuples ,to_insert )
13231323
13241324def test_create_rows_nested_nested_dictionary (self ):
@@ -1352,7 +1352,7 @@ def test_create_rows_nested_nested_dictionary(self):
13521352
13531353retry = RetryResult (_has_rows ,max_tries = 8 )
13541354rows = retry (self ._fetch_single_page )(table )
1355- row_tuples = [r .values ()for r in rows ]
1355+ row_tuples = [tuple ( r .values () )for r in rows ]
13561356expected_rows = [('Some value' ,record )]
13571357self .assertEqual (row_tuples ,expected_rows )
13581358
@@ -1379,7 +1379,7 @@ def test_create_table_rows_fetch_nested_schema(self):
13791379
13801380retry = RetryResult (_has_rows ,max_tries = 8 )
13811381fetched = retry (self ._fetch_single_page )(table )
1382- fetched_tuples = [f .values ()for f in fetched ]
1382+ fetched_tuples = [tuple ( f .values () )for f in fetched ]
13831383
13841384self .assertEqual (len (fetched ),len (to_insert ))
13851385