Skip to content

Commit 810e8dd

Browse files
committed
use shallow copy and add comments
1 parent 79e5fd9 commit 810e8dd

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

google/cloud/bigquery/client.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2041,7 +2041,6 @@ def _get_query_results(
20412041
query_params=extra_params,
20422042
timeout=timeout,
20432043
)
2044-
breakpoint()
20452044
return _QueryResults.from_api_repr(resource)
20462045

20472046
def job_from_resource(
@@ -4148,7 +4147,6 @@ def _list_rows_from_query_results(
41484147
params["startIndex"] = start_index
41494148

41504149
params["formatOptions.useInt64Timestamp"] = True
4151-
# breakpoint()
41524150
row_iterator = RowIterator(
41534151
client=self,
41544152
api_request=functools.partial(self._call_api, retry, timeout=timeout),

google/cloud/bigquery/table.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1991,8 +1991,13 @@ def _get_next_page_response(self):
19911991
return response
19921992

19931993
params = self._get_query_params()
1994-
import copy
1995-
params_copy = copy.deepcopy(params)
1994+
1995+
# If the user has provided page_size and start_index, we need to pass
1996+
# start_index for the first page, but for all subsequent pages, we
1997+
# should not pass start_index. We make a shallow copy of params and do
1998+
# not alter the original, so if the user iterates the results again,
1999+
# start_index is preserved.
2000+
params_copy = copy.copy(params)
19962001
if self._page_size is not None:
19972002
if self.page_number and "startIndex" in params:
19982003
del params_copy["startIndex"]

0 commit comments

Comments
 (0)