Skip to content

Commit 84c96e1

Browse files
authored
chore: update benchmark to assert on empty df returned by to_pandas_batches (#1907)
* chore: update benchmark to assert on empty df returned by to_pandas_batches * lint
1 parent c644df8 commit 84c96e1

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

tests/benchmark/read_gbq_colab/filter_output.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import pathlib
1515

1616
import benchmark.utils as utils
17-
import pytest
1817

1918
import bigframes.session
2019

@@ -40,11 +39,8 @@ def filter_output(
4039

4140
# It's possible we don't have any pages at all, since we filtered out all
4241
# matching rows.
43-
if rows == 0:
44-
with pytest.raises(StopIteration):
45-
next(iter(df_filtered.to_pandas_batches(page_size=PAGE_SIZE)))
46-
else:
47-
next(iter(df_filtered.to_pandas_batches(page_size=PAGE_SIZE)))
42+
first_page = next(iter(df_filtered.to_pandas_batches(page_size=PAGE_SIZE)))
43+
assert len(first_page.index) <= rows
4844

4945

5046
if __name__ == "__main__":

0 commit comments

Comments
 (0)