Skip to content

feat(pandas-gbq): add arrow decoder for read rows response - #17958

Open
shuoweil wants to merge 3 commits into
mainfrom
shuowei-gbq-pandas-gbq-arrow
Open

feat(pandas-gbq): add arrow decoder for read rows response#17958
shuoweil wants to merge 3 commits into
mainfrom
shuowei-gbq-pandas-gbq-arrow

Conversation

@shuoweil

@shuoweil shuoweil commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Adds pandas_gbq.arrow.from_read_rows_response to decode BigQuery Storage Read API ReadRowsResponse protobuf messages into pyarrow.RecordBatch instances.

Changes

  • pandas_gbq/arrow.py: Implements from_read_rows_response(message, arrow_schema=None) to deserialize IPC stream and message buffers with empty-batch fallback.
  • pandas_gbq/__init__.py: Exposes arrow in package __all__.
  • tests/unit/test_arrow.py: Adds unit tests for valid batch parsing, empty message handling, and missing pyarrow error handling.

Fixes #<540939659> 🦕

@shuoweil shuoweil self-assigned this Jul 30, 2026
@shuoweil
shuoweil requested review from a team as code owners July 30, 2026 21:28

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new arrow integration submodule in pandas-gbq to decode ReadRowsResponse protobuf messages into pyarrow.RecordBatch objects, along with corresponding unit tests. The review feedback points out that pyarrow.Message does not have a schema attribute, which would cause decoding to fail or fall back incorrectly. Additionally, it is recommended to catch specific pyarrow.ArrowException errors instead of using broad except Exception blocks.

Comment thread packages/pandas-gbq/pandas_gbq/arrow.py Outdated
shuoweil and others added 2 commits July 30, 2026 14:32
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant