Skip to content

Commit f433ecf

Browse files
authored
chore: avoid bq storage API deadlock by setting max_results. (#1355)
1 parent ab9229e commit f433ecf

File tree

22 files changed

+22
-22
lines changed

22 files changed

+22
-22
lines changed

scripts/tpch_result_verify.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ def verify(query_num=None):
772772
file_content = file.read()
773773

774774
file_content = re.sub(
775-
r"next\((\w+)\.to_pandas_batches\(\)\)",
775+
r"next\((\w+)\.to_pandas_batches\((.*?)\)\)",
776776
r"return \1.to_pandas()",
777777
file_content,
778778
)

third_party/bigframes_vendored/tpch/queries/q1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ def q(project_id: str, dataset_id: str, session: bigframes.Session):
3939
["L_RETURNFLAG", "L_LINESTATUS"]
4040
)
4141

42-
next(result.to_pandas_batches())
42+
next(result.to_pandas_batches(max_results=1500))

third_party/bigframes_vendored/tpch/queries/q10.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,4 @@ def q(project_id: str, dataset_id: str, session: bigframes.Session):
7676
.head(20)
7777
)
7878

79-
next(q_final.to_pandas_batches())
79+
next(q_final.to_pandas_batches(max_results=1500))

third_party/bigframes_vendored/tpch/queries/q11.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ def q(project_id: str, dataset_id: str, session: bigframes.Session):
4343

4444
result_df = result_df.sort_values(by="VALUE", ascending=False)
4545

46-
next(result_df.to_pandas_batches())
46+
next(result_df.to_pandas_batches(max_results=1500))

third_party/bigframes_vendored/tpch/queries/q12.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ def q(project_id: str, dataset_id: str, session: bigframes.Session):
4646

4747
agg_results = typing.cast(bpd.DataFrame, agg_results).sort_values("L_SHIPMODE")
4848

49-
next(agg_results.to_pandas_batches())
49+
next(agg_results.to_pandas_batches(max_results=1500))

third_party/bigframes_vendored/tpch/queries/q13.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ def q(project_id: str, dataset_id: str, session: bigframes.Session):
3434
["CUSTDIST", "C_COUNT"], ascending=[False, False]
3535
)
3636

37-
next(q_final.to_pandas_batches())
37+
next(q_final.to_pandas_batches(max_results=1500))

third_party/bigframes_vendored/tpch/queries/q14.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ def q(project_id: str, dataset_id: str, session: bigframes.Session):
4242
.to_frame(name="PROMO_REVENUE")
4343
)
4444

45-
next(promo_revenue_percent.to_pandas_batches())
45+
next(promo_revenue_percent.to_pandas_batches(max_results=1500))

third_party/bigframes_vendored/tpch/queries/q15.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ def q(project_id: str, dataset_id: str, session: bigframes.Session):
5050
q_final = max_revenue_suppliers[
5151
["S_SUPPKEY", "S_NAME", "S_ADDRESS", "S_PHONE", "TOTAL_REVENUE"]
5252
].sort_values("S_SUPPKEY")
53-
next(q_final.to_pandas_batches())
53+
next(q_final.to_pandas_batches(max_results=1500))

third_party/bigframes_vendored/tpch/queries/q16.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ def q(project_id: str, dataset_id: str, session: bigframes.Session):
4747
ascending=[False, True, True, True],
4848
)
4949

50-
next(q_final.to_pandas_batches())
50+
next(q_final.to_pandas_batches(max_results=1500))

third_party/bigframes_vendored/tpch/queries/q17.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ def q(project_id: str, dataset_id: str, session: bigframes.Session):
3737
(q_final[["L_EXTENDEDPRICE"]].sum() / 7.0).round(2).to_frame(name="AVG_YEARLY")
3838
)
3939

40-
next(q_final.to_pandas_batches())
40+
next(q_final.to_pandas_batches(max_results=1500))

0 commit comments

Comments
 (0)