Skip to content

fix test_parse test #126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 23, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions pandas_gbq/tests/test_gbq.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,12 +365,16 @@ def test_read_gbq_with_no_project_id_given_should_fail(self):
gbq.read_gbq('SELECT 1')

def test_that_parse_data_works_properly(self):

from google.cloud.bigquery.table import Row
test_schema = {'fields': [
{'mode': 'NULLABLE', 'name': 'valid_string', 'type': 'STRING'}]}
test_page = [{'f': [{'v': 'PI'}]}]
{'mode': 'NULLABLE', 'name': 'column_x', 'type': 'STRING'}]}
field_to_index = {'column_x': 0}
values = ('row_value',)
test_page = [Row(values, field_to_index)]

test_output = gbq._parse_data(test_schema, test_page)
correct_output = DataFrame({'valid_string': ['PI']})
correct_output = DataFrame({'column_x': ['row_value']})
tm.assert_frame_equal(test_output, correct_output)

def test_read_gbq_with_invalid_private_key_json_should_fail(self):
Expand Down