Skip to content

[pull] main from googleapis:main#42

Merged
pull[bot] merged 1 commit into
MC-MAGA:mainfrom
googleapis:main
Jan 9, 2026
Merged

[pull] main from googleapis:main#42
pull[bot] merged 1 commit into
MC-MAGA:mainfrom
googleapis:main

Conversation

@pull

@pull pull Bot commented Jan 9, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

### Description

This PR adds a `timeout` parameter to the `to_dataframe()` and
`to_arrow()` methods (and their corresponding `*_iterable`,
`*_geodataframe` and `QueryJob` wrappers) in the BigQuery client
library.

This addresses an issue where these methods could hang indefinitely if
the underlying BigQuery Storage API stream blocked (e.g., due to
firewall issues or network interruptions) during the download phase. The
added `timeout` parameter ensures that the download operation respects
the specified time limit and raises a `concurrent.futures.TimeoutError`
if it exceeds the duration.

### Changes

-   Modified `google/cloud/bigquery/_pandas_helpers.py`:
- Updated `_download_table_bqstorage` to accept a `timeout` argument.
    -   Implemented a timeout check within the result processing loop.
- Updated wrapper functions `download_dataframe_bqstorage` and
`download_arrow_bqstorage` to accept and pass the `timeout` parameter.
-   Modified `google/cloud/bigquery/table.py`:
- Updated `RowIterator` methods (`to_arrow_iterable`, `to_arrow`,
`to_dataframe_iterable`, `to_dataframe`, `to_geodataframe`) to accept
and pass `timeout`.
- Updated `_EmptyRowIterator` methods to match the `RowIterator`
signature, preventing `TypeError` when a timeout is provided for empty
result sets.
-   Modified `google/cloud/bigquery/job/query.py`:
- Updated `QueryJob` methods (`to_arrow`, `to_dataframe`,
`to_geodataframe`) to accept `timeout` and pass it to the result
iterator.
- Updated unit tests in `tests/unit/job/test_query_pandas.py`,
`tests/unit/test_table.py`, and `tests/unit/test_table_pandas.py` to
reflect the signature changes.

Fixes internal bug: b/468091307
@pull pull Bot locked and limited conversation to collaborators Jan 9, 2026
@pull pull Bot added the ⤵️ pull label Jan 9, 2026
@pull pull Bot merged commit 4f67ba2 into MC-MAGA:main Jan 9, 2026
10 of 11 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant