Skip to content

Commit 1155958

Browse files
max-sixtytswast
authored andcommitted
fix test_parse test (#126)
1 parent f2f2112 commit 1155958

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

pandas_gbq/tests/test_gbq.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,12 +365,16 @@ def test_read_gbq_with_no_project_id_given_should_fail(self):
365365
gbq.read_gbq('SELECT 1')
366366

367367
def test_that_parse_data_works_properly(self):
368+
369+
from google.cloud.bigquery.table import Row
368370
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)]
371375

372376
test_output = gbq._parse_data(test_schema, test_page)
373-
correct_output = DataFrame({'valid_string': ['PI']})
377+
correct_output = DataFrame({'column_x': ['row_value']})
374378
tm.assert_frame_equal(test_output, correct_output)
375379

376380
def test_read_gbq_with_invalid_private_key_json_should_fail(self):

0 commit comments

Comments
 (0)