Skip to content

Commit

Permalink
fix: fix for database name in batch create request (#883)
Browse files Browse the repository at this point in the history
* tests

* changes
  • Loading branch information
asthamohta authored Jan 17, 2023
1 parent 131964e commit 5e50beb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions google/cloud/spanner_v1/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def bind(self, database):
metadata = _metadata_with_prefix(database.name)
self._database_role = self._database_role or self._database.database_role
request = BatchCreateSessionsRequest(
database=database.database_id,
database=database.name,
session_count=self.size - self._sessions.qsize(),
session_template=Session(creator_role=self.database_role),
)
Expand Down Expand Up @@ -406,7 +406,7 @@ def bind(self, database):
self._database_role = self._database_role or self._database.database_role

request = BatchCreateSessionsRequest(
database=database.database_id,
database=database.name,
session_count=self.size - created_session_count,
session_template=Session(creator_role=self.database_role),
)
Expand Down
4 changes: 2 additions & 2 deletions tests/system/test_database_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def test_database_binding_of_fixed_size_pool(
default_timeout=500,
database_role="parent",
)
database = shared_instance.database(temp_db.name, pool=pool)
database = shared_instance.database(temp_db_id, pool=pool)
assert database._pool.database_role == "parent"


Expand Down Expand Up @@ -125,7 +125,7 @@ def test_database_binding_of_pinging_pool(
ping_interval=100,
database_role="parent",
)
database = shared_instance.database(temp_db.name, pool=pool)
database = shared_instance.database(temp_db_id, pool=pool)
assert database._pool.database_role == "parent"


Expand Down

0 comments on commit 5e50beb

Please sign in to comment.