Skip to content

Commit 8188ba7

Browse files
committed
fix a test
1 parent 63c2ab2 commit 8188ba7

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

bigframes/display/anywidget.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from typing import Any, cast, Dict, Iterator, List, Optional, Type
2222
import uuid
2323

24+
import google.api_core.exceptions
2425
import pandas as pd
2526

2627
import bigframes
@@ -166,8 +167,16 @@ def _get_next_batch(self) -> bool:
166167
batch = next(iterator)
167168
self._cached_batches.append(batch)
168169
return True
169-
except StopIteration:
170+
except (
171+
StopIteration,
172+
google.api_core.exceptions.GoogleAPICallError,
173+
TypeError,
174+
ValueError,
175+
) as e:
170176
self._all_data_loaded = True
177+
if not isinstance(e, StopIteration):
178+
# If we fail to get a batch, assume no more data is available.
179+
self.row_count = 0
171180
return False
172181

173182
@property

0 commit comments

Comments
 (0)