Skip to content

Commit e9fb712

Browse files
authored
feat!: set allow_large_results=False by default (#1541)
* feat!: set `allow_large_results=False` by default to optimize small result operations * adjust progress bar test for large result
1 parent b6b82ec commit e9fb712

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

bigframes/_config/bigquery_options.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def __init__(
8989
kms_key_name: Optional[str] = None,
9090
skip_bq_connection_check: bool = False,
9191
*,
92-
allow_large_results: bool = True,
92+
allow_large_results: bool = False,
9393
ordering_mode: Literal["strict", "partial"] = "strict",
9494
client_endpoints_override: Optional[dict] = None,
9595
):

tests/system/small/test_progress_bar.py

+13
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,19 @@ def test_progress_bar_scalar(penguins_df_default_index: bf.dataframe.DataFrame,
5555
with bf.option_context("display.progress_bar", "terminal"):
5656
penguins_df_default_index["body_mass_g"].head(10).mean()
5757

58+
assert capsys.readouterr().out == ""
59+
60+
61+
def test_progress_bar_scalar_allow_large_results(
62+
penguins_df_default_index: bf.dataframe.DataFrame, capsys
63+
):
64+
capsys.readouterr() # clear output
65+
66+
with bf.option_context(
67+
"display.progress_bar", "terminal", "bigquery.allow_large_results", "True"
68+
):
69+
penguins_df_default_index["body_mass_g"].head(10).mean()
70+
5871
assert_loading_msg_exist(capsys.readouterr().out)
5972

6073

tests/unit/_config/test_bigquery_options.py

+7
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,10 @@ def test_client_endpoints_override_set_shows_warning():
183183

184184
with pytest.warns(UserWarning):
185185
options.client_endpoints_override = {"bqclient": "endpoint_address"}
186+
187+
188+
def test_default_options():
189+
options = bigquery_options.BigQueryOptions()
190+
191+
assert options.allow_large_results is False
192+
assert options.ordering_mode == "strict"

0 commit comments

Comments
 (0)