File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -721,6 +721,9 @@ def read_gbq_table(
721
721
columns = columns ,
722
722
use_cache = use_cache ,
723
723
dry_run = dry_run ,
724
+ # If max_results has been set, we almost certainly have < 10 GB
725
+ # of results.
726
+ allow_large_results = False ,
724
727
)
725
728
return df
726
729
@@ -1040,7 +1043,14 @@ def read_gbq_query(
1040
1043
# local node. Likely there are a wide range of sizes in which it
1041
1044
# makes sense to download the results beyond the first page, even if
1042
1045
# there is a job and destination table available.
1043
- if rows is not None and destination is None :
1046
+ if (
1047
+ rows is not None
1048
+ and destination is None
1049
+ and (
1050
+ query_job_for_metrics is None
1051
+ or query_job_for_metrics .statement_type == "SELECT"
1052
+ )
1053
+ ):
1044
1054
return bf_read_gbq_query .create_dataframe_from_row_iterator (
1045
1055
rows ,
1046
1056
session = self ._session ,
Original file line number Diff line number Diff line change @@ -619,7 +619,7 @@ def test_read_gbq_wildcard(
619
619
pytest .param (
620
620
{"query" : {"useQueryCache" : False , "maximumBytesBilled" : "100" }},
621
621
marks = pytest .mark .xfail (
622
- raises = google .api_core .exceptions .InternalServerError ,
622
+ raises = google .api_core .exceptions .BadRequest ,
623
623
reason = "Expected failure when the query exceeds the maximum bytes billed limit." ,
624
624
),
625
625
),
You can’t perform that action at this time.
0 commit comments