Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion google/cloud/bigquery/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2850,7 +2850,7 @@ def _do_resumable_upload(
)

while not upload.finished:
response = upload.transmit_next_chunk(transport)
response = upload.transmit_next_chunk(transport, timeout=timeout)

return response

Expand Down
16 changes: 16 additions & 0 deletions tests/unit/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -8235,6 +8235,22 @@ def test__do_resumable_upload_custom_project(self):
assert initiation_url is not None
assert "projects/custom-project" in initiation_url

def test__do_resumable_upload_custom_timeout(self):
file_obj = self._make_file_obj()
file_obj_len = len(file_obj.getvalue())
transport = self._make_transport(
self._make_resumable_upload_responses(file_obj_len)
)
client = self._make_client(transport)

client._do_resumable_upload(
file_obj, self.EXPECTED_CONFIGURATION, num_retries=0, timeout=3.14
)

# The timeout should be applied to all underlying calls.
for call_args in transport.request.call_args_list:
assert call_args.kwargs.get("timeout") == 3.14

def test__do_multipart_upload(self):
transport = self._make_transport([self._make_response(http.client.OK)])
client = self._make_client(transport)
Expand Down