-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
api: bigqueryIssues related to the BigQuery API.Issues related to the BigQuery API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.
Description
Current there's a to_dataframe() method that returns a pandas DataFrame from a query. DataFrames don't efficiently support array and struct values, but pyarrow provides efficient support for them:
In [11]: import pyarrow as pa
In [13]: a = pa.array(
...: [
...: {'a': [1, 2, 3]}
...: ],
...: pa.struct([pa.field('a', pa.list_(pa.int64()))])
...: )
In [14]: a
Out[14]:
<pyarrow.lib.StructArray object at 0x7f55f8764b88>
[
{'a': [1, 2, 3]}
]A to_arrow() method will make it easier to efficiently support more complex types going forward in downstream libraries like ibis.
max-sixty, ostrokach and tswast
Metadata
Metadata
Labels
api: bigqueryIssues related to the BigQuery API.Issues related to the BigQuery API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.