Skip to content

Commit 5d92009

Browse files
authored
update_bigquery_release_files: disable built-in retries from google bigquery client (#18260)
1 parent 4eeb73c commit 5d92009

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

tests/unit/packaging/test_tasks.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -500,13 +500,13 @@ def process_formdata(self, valuelist):
500500
[
501501
(
502502
"example.pypi.distributions",
503-
[pretend.call("example.pypi.distributions")],
503+
[pretend.call("example.pypi.distributions", timeout=5.0, retry=None)],
504504
),
505505
(
506506
"example.pypi.distributions some.other.table",
507507
[
508-
pretend.call("example.pypi.distributions"),
509-
pretend.call("some.other.table"),
508+
pretend.call("example.pypi.distributions", timeout=5.0, retry=None),
509+
pretend.call("some.other.table", timeout=5.0, retry=None),
510510
],
511511
),
512512
],
@@ -533,7 +533,7 @@ def test_insert_new_row(
533533

534534
get_table = pretend.stub(schema=bq_schema)
535535
bigquery = pretend.stub(
536-
get_table=pretend.call_recorder(lambda t: get_table),
536+
get_table=pretend.call_recorder(lambda *a, **kw: get_table),
537537
insert_rows_json=pretend.call_recorder(lambda *a, **kw: []),
538538
)
539539

@@ -651,7 +651,8 @@ def find_service(name=None):
651651
"blake2_256_digest": release_file.blake2_256_digest,
652652
},
653653
],
654-
timeout=5,
654+
timeout=5.0,
655+
retry=None,
655656
)
656657
for table in release_files_table.split()
657658
]

warehouse/packaging/tasks.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ def update_bigquery_release_files(task, request, dist_metadata):
312312
table_names = release_files_table.split()
313313

314314
for table_name in table_names:
315-
table_schema = bq.get_table(table_name).schema
315+
table_schema = bq.get_table(table_name, timeout=5.0, retry=None).schema
316316

317317
# Using the schema to populate the data allows us to automatically
318318
# set the values to their respective fields rather than assigning
@@ -346,7 +346,9 @@ def update_bigquery_release_files(task, request, dist_metadata):
346346
json_rows[sch.name] = field_data
347347
json_rows = [json_rows]
348348

349-
bq.insert_rows_json(table=table_name, json_rows=json_rows, timeout=5)
349+
bq.insert_rows_json(
350+
table=table_name, json_rows=json_rows, timeout=5.0, retry=None
351+
)
350352

351353

352354
@tasks.task(ignore_result=True, acks_late=True)

0 commit comments

Comments
 (0)