Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion bigtable/docs/snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,18 @@ def test_bigtable_create_table():
table = instance.table("table_my")
# Define the GC policy to retain only the most recent 2 versions.
max_versions_rule = column_family.MaxVersionsGCRule(2)
table.create(column_families={"cf1": max_versions_rule})

RETRIES = 4
# Retry if deadline exceed error.
for retry in range(RETRIES):
try:
table.create(column_families={"cf1": max_versions_rule})
break
except Exception as e:
if retry == RETRIES - 1:
raise e
else:
time.sleep(2 ** (retry - 1))
# [END bigtable_create_table]

try:
Expand Down