File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -365,12 +365,16 @@ def test_read_gbq_with_no_project_id_given_should_fail(self):
365
365
gbq .read_gbq ('SELECT 1' )
366
366
367
367
def test_that_parse_data_works_properly (self ):
368
+
369
+ from google .cloud .bigquery .table import Row
368
370
test_schema = {'fields' : [
369
- {'mode' : 'NULLABLE' , 'name' : 'valid_string' , 'type' : 'STRING' }]}
370
- test_page = [{'f' : [{'v' : 'PI' }]}]
371
+ {'mode' : 'NULLABLE' , 'name' : 'column_x' , 'type' : 'STRING' }]}
372
+ field_to_index = {'column_x' : 0 }
373
+ values = ('row_value' ,)
374
+ test_page = [Row (values , field_to_index )]
371
375
372
376
test_output = gbq ._parse_data (test_schema , test_page )
373
- correct_output = DataFrame ({'valid_string ' : ['PI ' ]})
377
+ correct_output = DataFrame ({'column_x ' : ['row_value ' ]})
374
378
tm .assert_frame_equal (test_output , correct_output )
375
379
376
380
def test_read_gbq_with_invalid_private_key_json_should_fail (self ):
You can’t perform that action at this time.
0 commit comments