Repository navigation
fix(bigquery): pass timeout to the table lookup when loading dataframes and JSON - #18937
Open
abhishekacharya200 wants to merge 1 commit into
Open
abhishekacharya200 wants to merge 1 commit into
abhishekacharya200 wants to merge 1 commit into
Conversation
…taframe and load_table_from_json Both methods call get_table before uploading, without the caller's timeout. BigQuery's default timeout is None, so that request could hang however short a timeout was set.
abhishekacharya200
requested review from
sycai
and removed request for
a team
October 31, 2026 13:07
Contributor
There was a problem hiding this comment.
Code Review
This pull request ensures that the timeout parameter is correctly passed to the get_table lookup in both load_table_from_dataframe and load_table_from_json methods of the BigQuery client. Corresponding unit tests have been added to verify this behavior. I have no feedback to provide as there are no review comments.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #18936
load_table_from_dataframeandload_table_from_jsontake atimeout, but theget_table(destination)call they make before uploading didn't receive it. BigQuery'sDEFAULT_TIMEOUTisNone, so that request had no timeout at all and could hang however short a timeout the caller set.This passes
timeoutto both lookups. Callers who don't set one still getNone, as before. Both methods typetimeoutasResumableTimeoutType, which can be a(connect, read)tuple;get_tablehands it to the same HTTP layer, so a tuple works there too, though the tests only use a float.Added
test_load_table_from_dataframe_passes_timeout_to_table_lookupandtest_load_table_from_json_passes_timeout_to_table_lookup, which fail onmainand pass with this change.tests/unit/test_client.pypasses (285 passed, 1 skipped). black 23.7.0 and flake8 report nothing on the changed files.This is the same gap as #18767, in two other methods, and the two PRs don't touch the same lines.