Revert "fix: table iterator should not use bqstorage when page_size i… · googleapis/python-bigquery@453d7ec · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

Commit 453d7ec

Browse files
committed
Revert "fix: table iterator should not use bqstorage when page_size is not None (#2154)"
This reverts commit e89a707.
1 parent bf58ca5 commit 453d7ec

File tree

3 files changed

+2
-17
lines changed

3 files changed

+2
-17
lines changed

google/cloud/bigquery/table.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1897,11 +1897,6 @@ def total_bytes_processed(self) -> Optional[int]:
18971897
"""total bytes processed from job statistics, if present."""
18981898
return self._total_bytes_processed
18991899

1900-
@property
1901-
def page_size(self) -> Optional[int]:
1902-
"""The maximum number of rows in each page of results from this request, if present."""
1903-
return self._page_size
1904-
19051900
def _is_almost_completely_cached(self):
19061901
"""Check if all results are completely cached.
19071902
@@ -1953,7 +1948,7 @@ def _should_use_bqstorage(self, bqstorage_client, create_bqstorage_client):
19531948
if self._is_almost_completely_cached():
19541949
return False
19551950

1956-
if self.max_results is not None or self.page_size is not None:
1951+
if self.max_results is not None:
19571952
return False
19581953

19591954
try:
@@ -2023,9 +2018,7 @@ def _maybe_warn_max_results(
20232018
bqstorage_client:
20242019
The BigQuery Storage client intended to use for downloading result rows.
20252020
"""
2026-
if bqstorage_client is not None and (
2027-
self.max_results is not None or self.page_size is not None
2028-
):
2021+
if bqstorage_client is not None and self.max_results is not None:
20292022
warnings.warn(
20302023
"Cannot use bqstorage_client if max_results is set, "
20312024
"reverting to fetching data with the REST endpoint.",

tests/unit/test_dbapi_cursor.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ def _mock_rows(
161161
mock_rows,
162162
)
163163
mock_rows.max_results = None
164-
mock_rows.page_size = None
165164
type(mock_rows).job_id = mock.PropertyMock(return_value="test-job-id")
166165
type(mock_rows).location = mock.PropertyMock(return_value="test-location")
167166
type(mock_rows).num_dml_affected_rows = mock.PropertyMock(

tests/unit/test_table.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2858,13 +2858,6 @@ def test__should_use_bqstorage_returns_false_if_max_results_set(self):
28582858
)
28592859
self.assertFalse(result)
28602860

2861-
def test__should_use_bqstorage_returns_false_if_page_size_set(self):
2862-
iterator = self._make_one(page_size=10, first_page_response=None) # not cached
2863-
result = iterator._should_use_bqstorage(
2864-
bqstorage_client=None, create_bqstorage_client=True
2865-
)
2866-
self.assertFalse(result)
2867-
28682861
def test__should_use_bqstorage_returns_false_w_warning_if_missing_dependency(self):
28692862
iterator = self._make_one(first_page_response=None) # not cached
28702863

0 commit comments

Comments
 (0)

TMZ Celebrity News – Breaking Stories, Videos & Gossip

Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

🎥 Watch TMZ Live

TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.