Skip to content
This repository was archived by the owner on Jun 8, 2026. It is now read-only.
Merged
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 the reconciling field when reloading a database.
  • Loading branch information
aayushimalik committed May 11, 2023
commit babd236ff2a0db2d3c402377385f7e5fb0ba9d5b
1 change: 1 addition & 0 deletions google/cloud/spanner_v1/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,7 @@ def reload(self):
self._default_leader = response.default_leader
self._database_dialect = response.database_dialect
self._enable_drop_protection = response.enable_drop_protection
self._reconciling = response.reconciling

def update_ddl(self, ddl_statements, operation_id=""):
"""Update DDL for this database.
Expand Down
4 changes: 4 additions & 0 deletions tests/unit/test_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,8 @@ def test_reload_success(self):
encryption_config=encryption_config,
encryption_info=encryption_info,
default_leader=default_leader,
reconciling=True,
enable_drop_protection=True
)
api.get_database.return_value = db_pb
instance = _Instance(self.INSTANCE_NAME, client=client)
Expand All @@ -763,6 +765,8 @@ def test_reload_success(self):
self.assertEqual(database._encryption_config, encryption_config)
self.assertEqual(database._encryption_info, encryption_info)
self.assertEqual(database._default_leader, default_leader)
self.assertEqual(database._reconciling, True)
self.assertEqual(database._enable_drop_protection, True)

api.get_database_ddl.assert_called_once_with(
database=self.DATABASE_NAME,
Expand Down