Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

Commit e6294d0

Browse files
authored
Merge branch 'main' into owl-bot-copy
2 parents f5d3b81 + aae8d61 commit e6294d0

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

google/cloud/spanner_dbapi/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,7 @@ def connect(
798798
database = None
799799
if database_id:
800800
database = instance.database(database_id, pool=pool)
801-
conn = Connection(instance, database)
801+
conn = Connection(instance, database, **kwargs)
802802
if pool is not None:
803803
conn._own_pool = False
804804

tests/unit/spanner_dbapi/test_connect.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,17 @@ def test_w_credential_file_path(self, mock_client):
131131
client_info = factory.call_args_list[0][1]["client_info"]
132132
self.assertEqual(client_info.user_agent, USER_AGENT)
133133
self.assertEqual(client_info.python_version, PY_VERSION)
134+
135+
def test_with_kwargs(self, mock_client):
136+
from google.cloud.spanner_dbapi import connect
137+
from google.cloud.spanner_dbapi import Connection
138+
139+
client = mock_client.return_value
140+
instance = client.instance.return_value
141+
database = instance.database.return_value
142+
self.assertIsNotNone(database)
143+
144+
connection = connect(INSTANCE, DATABASE, ignore_transaction_warnings=True)
145+
146+
self.assertIsInstance(connection, Connection)
147+
self.assertTrue(connection._ignore_transaction_warnings)

0 commit comments

Comments
 (0)