From 8bb4394821322c4a127e6a1e33d8b4eb2e08f150 Mon Sep 17 00:00:00 2001 From: Astha Mohta Date: Tue, 17 Jan 2023 21:51:37 +0530 Subject: [PATCH 1/3] tests --- google/cloud/spanner_v1/pool.py | 4 ++-- tests/system/test_database_api.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/google/cloud/spanner_v1/pool.py b/google/cloud/spanner_v1/pool.py index 886e28d7f7..7455d0cd20 100644 --- a/google/cloud/spanner_v1/pool.py +++ b/google/cloud/spanner_v1/pool.py @@ -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), ) @@ -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), ) diff --git a/tests/system/test_database_api.py b/tests/system/test_database_api.py index 699b3f4a69..11dbd1ca43 100644 --- a/tests/system/test_database_api.py +++ b/tests/system/test_database_api.py @@ -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" @@ -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" From a75fb636344eb0a98255a3783144f27bfa753b8f Mon Sep 17 00:00:00 2001 From: Astha Mohta Date: Tue, 17 Jan 2023 22:41:49 +0530 Subject: [PATCH 2/3] changes --- tests/system/test_database_api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/system/test_database_api.py b/tests/system/test_database_api.py index 11dbd1ca43..364c159da5 100644 --- a/tests/system/test_database_api.py +++ b/tests/system/test_database_api.py @@ -97,7 +97,7 @@ def test_database_binding_of_fixed_size_pool( default_timeout=500, database_role="parent", ) - database = shared_instance.database(temp_db.id, pool=pool) + database = shared_instance.database(temp_db_id, pool=pool) assert database._pool.database_role == "parent" @@ -125,7 +125,7 @@ def test_database_binding_of_pinging_pool( ping_interval=100, database_role="parent", ) - database = shared_instance.database(temp_db.id, pool=pool) + database = shared_instance.database(temp_db_id, pool=pool) assert database._pool.database_role == "parent" From 93b5292bb8e874433cb49a0781ed5cdef11adf78 Mon Sep 17 00:00:00 2001 From: Astha Mohta Date: Mon, 23 Jan 2023 13:28:03 +0530 Subject: [PATCH 3/3] changes in fgac tag --- samples/samples/snippets.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/samples/snippets.py b/samples/samples/snippets.py index ad138b3a1c..a447121010 100644 --- a/samples/samples/snippets.py +++ b/samples/samples/snippets.py @@ -2314,7 +2314,7 @@ def list_instance_config_operations(): def add_and_drop_database_roles(instance_id, database_id): """Showcases how to manage a user defined database role.""" - # [START spanner_add_and_drop_database_roles] + # [START spanner_add_and_drop_database_role] # instance_id = "your-spanner-instance" # database_id = "your-spanner-db-id" spanner_client = spanner.Client() @@ -2345,7 +2345,7 @@ def add_and_drop_database_roles(instance_id, database_id): operation.result(OPERATION_TIMEOUT_SECONDS) print("Revoked privileges and dropped role {}".format(role_child)) - # [END spanner_add_and_drop_database_roles] + # [END spanner_add_and_drop_database_role] def read_data_with_database_role(instance_id, database_id):