Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Changelog
=========

0.3.2 / [TBD]
------------------
- Fix bug with querying for an array of floats (:issue:`123`)

0.3.1 / 2018-02-13
------------------

Expand Down
2 changes: 2 additions & 0 deletions pandas_gbq/gbq.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,8 @@ def _parse_data(schema, rows):
col_names = [str(field['name']) for field in fields]
col_dtypes = [
dtype_map.get(field['type'].upper(), object)
if field['mode'] != 'repeated'
else object
for field in fields
]
page_array = np.zeros((len(rows),), dtype=lzip(col_names, col_dtypes))
Expand Down
8 changes: 8 additions & 0 deletions pandas_gbq/tests/test_gbq.py
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,14 @@ def test_array_agg(self):
tm.assert_frame_equal(df, DataFrame([["a", [1, 3]], ["b", [2]]],
columns=["letter", "numbers"]))

def test_array_of_floats(self):
query = """select [1.1, 2.2, 3.3] as a, 4 as b"""
df = gbq.read_gbq(query, project_id=_get_project_id(),
private_key=_get_private_key_path(),
dialect='standard')
tm.assert_frame_equal(df, DataFrame([[[1.1, 2.2, 3.3], 4]],
columns=["a", "b"]))


class TestToGBQIntegrationWithServiceAccountKeyPath(object):
# Changes to BigQuery table schema may take up to 2 minutes as of May 2015
Expand Down