Skip to content
This repository was archived by the owner on Jun 8, 2026. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Update field name drop_protection_enabled to enable_drop_protection.
  • Loading branch information
aayushimalik committed Apr 13, 2023
commit 545cd8c839d8b7d7d72636e5b3a7e7f4eaa6837b
8 changes: 4 additions & 4 deletions samples/samples/snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,15 @@ def update_database(instance_id, database_id):
instance = spanner_client.instance(instance_id)

db = instance.database(database_id)
db.drop_protection_enabled = True
db.enable_drop_protection = True

operation = db.update()
operation = db.update(["enable_drop_protection"])

print("Waiting for update operation for {} to complete...".format(
db.database_id))
db.name))
operation.result(OPERATION_TIMEOUT_SECONDS)

print("Updated database {}.".format(db.database_id))
print("Updated database {}.".format(db.name))


# [END spanner_update_database]
Expand Down
6 changes: 3 additions & 3 deletions samples/samples/snippets_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,11 @@ def test_update_database(capsys, instance_id, sample_database):
instance_id, sample_database.database_id
)
out, _ = capsys.readouterr()
assert "Updated database {}.".format(sample_database.database_id) in out
assert "Updated database {}.".format(sample_database.name) in out

# Cleanup
sample_database.drop_protection_enabled = False
op = sample_database.update()
sample_database.enable_drop_protection = False
op = sample_database.update(["enable_drop_protection"])
op.result()


Expand Down