File tree Expand file tree Collapse file tree 4 files changed +15
-13
lines changed Expand file tree Collapse file tree 4 files changed +15
-13
lines changed Original file line number Diff line number Diff line change @@ -508,7 +508,7 @@ def connect(
508
508
pool = None ,
509
509
user_agent = None ,
510
510
client = None ,
511
- route_to_leader_enabled = True ,
511
+ route_to_leader_enabled = False ,
512
512
):
513
513
"""Creates a connection to a Google Cloud Spanner database.
514
514
@@ -547,9 +547,10 @@ def connect(
547
547
548
548
:type route_to_leader_enabled: boolean
549
549
:param route_to_leader_enabled:
550
- (Optional) Default True. Set route_to_leader_enabled as False to
551
- disable leader aware routing. Disabling leader aware routing would
552
- route all requests in RW/PDML transactions to the closest region.
550
+ (Optional) Default False. Set route_to_leader_enabled as True to
551
+ enable leader aware routing. Enabling leader aware routing
552
+ would route all requests in RW/PDML transactions to the
553
+ leader region.
553
554
554
555
555
556
:rtype: :class:`google.cloud.spanner_dbapi.connection.Connection`
@@ -567,14 +568,14 @@ def connect(
567
568
credentials ,
568
569
project = project ,
569
570
client_info = client_info ,
570
- route_to_leader_enabled = True ,
571
+ route_to_leader_enabled = False ,
571
572
)
572
573
else :
573
574
client = spanner .Client (
574
575
project = project ,
575
576
credentials = credentials ,
576
577
client_info = client_info ,
577
- route_to_leader_enabled = True ,
578
+ route_to_leader_enabled = False ,
578
579
)
579
580
else :
580
581
if project is not None and client .project != project :
Original file line number Diff line number Diff line change @@ -116,9 +116,10 @@ class Client(ClientWithProject):
116
116
117
117
:type route_to_leader_enabled: boolean
118
118
:param route_to_leader_enabled:
119
- (Optional) Default True. Set route_to_leader_enabled as False to
120
- disable leader aware routing. Disabling leader aware routing would
121
- route all requests in RW/PDML transactions to the closest region.
119
+ (Optional) Default False. Set route_to_leader_enabled as True to
120
+ enable leader aware routing. Enabling leader aware routing
121
+ would route all requests in RW/PDML transactions to the
122
+ leader region.
122
123
123
124
:raises: :class:`ValueError <exceptions.ValueError>` if both ``read_only``
124
125
and ``admin`` are :data:`True`
@@ -138,7 +139,7 @@ def __init__(
138
139
client_info = _CLIENT_INFO ,
139
140
client_options = None ,
140
141
query_options = None ,
141
- route_to_leader_enabled = True ,
142
+ route_to_leader_enabled = False ,
142
143
):
143
144
self ._emulator_host = _get_spanner_emulator_host ()
144
145
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ def test_w_explicit(self, mock_client):
86
86
project = PROJECT ,
87
87
credentials = credentials ,
88
88
client_info = mock .ANY ,
89
- route_to_leader_enabled = True ,
89
+ route_to_leader_enabled = False ,
90
90
)
91
91
client_info = mock_client .call_args_list [0 ][1 ]["client_info" ]
92
92
self .assertEqual (client_info .user_agent , USER_AGENT )
@@ -120,7 +120,7 @@ def test_w_credential_file_path(self, mock_client):
120
120
credentials_path ,
121
121
project = PROJECT ,
122
122
client_info = mock .ANY ,
123
- route_to_leader_enabled = True ,
123
+ route_to_leader_enabled = False ,
124
124
)
125
125
client_info = factory .call_args_list [0 ][1 ]["client_info" ]
126
126
self .assertEqual (client_info .user_agent , USER_AGENT )
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ def _constructor_test_helper(
59
59
client_options = None ,
60
60
query_options = None ,
61
61
expected_query_options = None ,
62
- route_to_leader_enabled = True ,
62
+ route_to_leader_enabled = None ,
63
63
):
64
64
import google .api_core .client_options
65
65
from google .cloud .spanner_v1 import client as MUT
You can’t perform that action at this time.
0 commit comments