Uh oh!
There was an error while loading. Please reload this page.
feat(pandas-gbq): add arrow decoder for read rows response - #17958
Conversation
There was a problem hiding this comment.
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.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
parthea
commented
Jul 31, 2026
shuoweil
commented
Jul 31, 2026
| mock_message = mock.MagicMock() | ||
| with mock.patch.object(pandas_gbq.arrow, "pa", None): | ||
| import pytest |
There was a problem hiding this comment.
nit: let's import pytest at the top of the file.
There was a problem hiding this comment.
Done, I move import pytest to the top-level imports.
| import pyarrow as pa | ||
| import pandas_gbq.arrow | ||
There was a problem hiding this comment.
Could we add a test case where the arrow schema is not provided?
There was a problem hiding this comment.
Sure, test case is added.
Uh oh!
There was an error while loading. Please reload this page.
🤖 I have created a release *beep* *boop* --- ## [0.35.1](pandas-gbq-v0.35.0...pandas-gbq-v0.35.1) (2026-08-06) ### Features * **pandas-gbq:** add arrow decoder for read rows response ([#17958](#17958)) ([e1df28c](e1df28c)) ### Bug Fixes * require Protobuf 6.33.5+ ([#17743](#17743)) ([d267342](d267342)) ### Documentation * add project ID to pandas-gbq run sample ([#17692](#17692)) ([bd5d1a4](bd5d1a4)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Adds
pandas_gbq.arrow.from_read_rows_responseto decode BigQuery Storage Read APIReadRowsResponseprotobuf messages intopyarrow.RecordBatchinstances.Changes
pandas_gbq/arrow.py: Implementsfrom_read_rows_response(message, arrow_schema=None)to deserialize IPC stream and message buffers with empty-batch fallback.pandas_gbq/__init__.py: Exposesarrowin package__all__.tests/unit/test_arrow.py: Adds unit tests for valid batch parsing, empty message handling, and missingpyarrowerror handling.Fixes #<540939659> 🦕