Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit 3b770ae

Browse files
committed
default to global option
1 parent 68f1a10 commit 3b770ae

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

bigframes/pandas/io/api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ def read_gbq_query( # type: ignore[overload-overlap]
395395
col_order: Iterable[str] = ...,
396396
filters: vendored_pandas_gbq.FiltersType = ...,
397397
dry_run: Literal[False] = ...,
398-
allow_large_results: bool = ...,
398+
allow_large_results: Optional[bool] = ...,
399399
) -> bigframes.dataframe.DataFrame:
400400
...
401401

@@ -412,7 +412,7 @@ def read_gbq_query(
412412
col_order: Iterable[str] = ...,
413413
filters: vendored_pandas_gbq.FiltersType = ...,
414414
dry_run: Literal[True] = ...,
415-
allow_large_results: bool = ...,
415+
allow_large_results: Optional[bool] = ...,
416416
) -> pandas.Series:
417417
...
418418

@@ -428,7 +428,7 @@ def read_gbq_query(
428428
col_order: Iterable[str] = (),
429429
filters: vendored_pandas_gbq.FiltersType = (),
430430
dry_run: bool = False,
431-
allow_large_results: bool = True,
431+
allow_large_results: Optional[bool] = None,
432432
) -> bigframes.dataframe.DataFrame | pandas.Series:
433433
_set_default_session_location_if_possible(query)
434434
return global_session.with_default_session(

bigframes/session/__init__.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959

6060
from bigframes import exceptions as bfe
6161
from bigframes import version
62+
import bigframes._config
6263
import bigframes._config.bigquery_options as bigquery_options
6364
import bigframes.clients
6465
import bigframes.constants
@@ -554,7 +555,7 @@ def read_gbq_query( # type: ignore[overload-overlap]
554555
col_order: Iterable[str] = ...,
555556
filters: third_party_pandas_gbq.FiltersType = ...,
556557
dry_run: Literal[False] = ...,
557-
allow_large_results: bool = ...,
558+
allow_large_results: Optional[bool] = ...,
558559
) -> dataframe.DataFrame:
559560
...
560561

@@ -571,7 +572,7 @@ def read_gbq_query(
571572
col_order: Iterable[str] = ...,
572573
filters: third_party_pandas_gbq.FiltersType = ...,
573574
dry_run: Literal[True] = ...,
574-
allow_large_results: bool = ...,
575+
allow_large_results: Optional[bool] = ...,
575576
) -> pandas.Series:
576577
...
577578

@@ -587,7 +588,7 @@ def read_gbq_query(
587588
col_order: Iterable[str] = (),
588589
filters: third_party_pandas_gbq.FiltersType = (),
589590
dry_run: bool = False,
590-
allow_large_results: bool = True,
591+
allow_large_results: Optional[bool] = None,
591592
) -> dataframe.DataFrame | pandas.Series:
592593
"""Turn a SQL query into a DataFrame.
593594
@@ -672,7 +673,7 @@ def read_gbq_query(
672673
allow_large_results (bool, optional):
673674
Whether to allow large query results. If ``True``, the query
674675
results can be larger than the maximum response size.
675-
Defaults to ``True``.
676+
Defaults to ``bpd.options.compute.allow_large_results``.
676677
677678
Returns:
678679
bigframes.pandas.DataFrame or pandas.Series:
@@ -693,6 +694,9 @@ def read_gbq_query(
693694
elif col_order:
694695
columns = col_order
695696

697+
if allow_large_results is None:
698+
allow_large_results = bigframes._config.options._allow_large_results
699+
696700
return self._loader.read_gbq_query( # type: ignore # for dry_run overload
697701
query=query,
698702
index_col=index_col,

0 commit comments

Comments
 (0)