diff --git a/spanner/cloud-client/backup_sample.py b/spanner/cloud-client/backup_sample.py index c8bcce82b83..e19bd797f4a 100644 --- a/spanner/cloud-client/backup_sample.py +++ b/spanner/cloud-client/backup_sample.py @@ -42,7 +42,7 @@ def create_backup(instance_id, database_id, backup_id): operation = backup.create() # Wait for backup operation to complete. - operation.result() + operation.result(1200) # Verify that the backup is ready. backup.reload() @@ -68,7 +68,7 @@ def restore_database(instance_id, new_database_id, backup_id): operation = new_database.restore(backup) # Wait for restore operation to complete. - operation.result() + operation.result(1200) # Newly created database has restore information. new_database.reload() diff --git a/spanner/cloud-client/snippets.py b/spanner/cloud-client/snippets.py index ff7ae513cac..2b565609fe4 100644 --- a/spanner/cloud-client/snippets.py +++ b/spanner/cloud-client/snippets.py @@ -52,7 +52,7 @@ def create_database(instance_id, database_id): operation = database.create() print('Waiting for operation to complete...') - operation.result() + operation.result(120) print('Created database {} on instance {}'.format( database_id, instance_id)) @@ -213,7 +213,7 @@ def add_index(instance_id, database_id): 'CREATE INDEX AlbumsByAlbumTitle ON Albums(AlbumTitle)']) print('Waiting for operation to complete...') - operation.result() + operation.result(120) print('Added the AlbumsByAlbumTitle index.') # [END spanner_create_index] @@ -306,7 +306,7 @@ def add_storing_index(instance_id, database_id): 'STORING (MarketingBudget)']) print('Waiting for operation to complete...') - operation.result() + operation.result(120) print('Added the AlbumsByAlbumTitle2 index.') # [END spanner_create_storing_index] @@ -355,7 +355,7 @@ def add_column(instance_id, database_id): 'ALTER TABLE Albums ADD COLUMN MarketingBudget INT64']) print('Waiting for operation to complete...') - operation.result() + operation.result(120) print('Added the MarketingBudget column.') # [END spanner_add_column] @@ -509,7 +509,7 @@ def create_table_with_timestamp(instance_id, database_id): ]) print('Waiting for operation to complete...') - operation.result() + operation.result(120) print('Created Performances table on database {} on instance {}'.format( database_id, instance_id)) @@ -554,7 +554,7 @@ def add_timestamp_column(instance_id, database_id): 'OPTIONS(allow_commit_timestamp=true)']) print('Waiting for operation to complete...') - operation.result() + operation.result(120) print('Altered table "Albums" on database {} on instance {}.'.format( database_id, instance_id)) @@ -1122,7 +1122,7 @@ def create_table_with_datatypes(instance_id, database_id): ]) print('Waiting for operation to complete...') - operation.result() + operation.result(120) print('Created Venues table on database {} on instance {}'.format( database_id, instance_id))