1414import pathlib
1515
1616import bigframes .pandas
17- import bigframes .session .execution_spec
1817import tests .benchmark .utils as utils
1918
2019PAGE_SIZE = utils .READ_GBQ_COLAB_PAGE_SIZE
@@ -27,16 +26,8 @@ def sort_output(*, project_id, dataset_id, table_id):
2726 f"SELECT * FROM `{ project_id } `.{ dataset_id } .{ table_id } "
2827 )
2928
30- # Call the executor directly to isolate the query execution time
31- # from other DataFrame overhead for this benchmark.
32- execute_result = df ._block .session ._executor .execute (
33- df ._block .expr ,
34- execution_spec = bigframes .session .execution_spec .ExecutionSpec (
35- ordered = True , promise_under_10gb = False
36- ),
37- )
38- assert execute_result .total_rows is not None and execute_result .total_rows >= 0
39- batches = execute_result .to_pandas_batches (page_size = PAGE_SIZE )
29+ batches = df .to_pandas_batches (page_size = PAGE_SIZE )
30+ assert batches .total_rows is not None and batches .total_rows >= 0
4031 next (iter (batches ))
4132
4233 # Simulate the user sorting by a column and visualizing those results
@@ -45,17 +36,8 @@ def sort_output(*, project_id, dataset_id, table_id):
4536 sort_column = "col_bool_0"
4637
4738 df_sorted = df .sort_values (sort_column )
48- execute_result_sorted = df_sorted ._block .session ._executor .execute (
49- df_sorted ._block .expr ,
50- execution_spec = bigframes .session .execution_spec .ExecutionSpec (
51- ordered = True , promise_under_10gb = False
52- ),
53- )
54- assert (
55- execute_result_sorted .total_rows is not None
56- and execute_result_sorted .total_rows >= 0
57- )
58- batches_sorted = execute_result_sorted .to_pandas_batches (page_size = PAGE_SIZE )
39+ batches_sorted = df_sorted .to_pandas_batches (page_size = PAGE_SIZE )
40+ assert batches_sorted .total_rows is not None and batches_sorted .total_rows >= 0
5941 next (iter (batches_sorted ))
6042
6143
0 commit comments