@@ -176,6 +176,11 @@ class Client(ClientWithProject):
176176 or :class:`dict`
177177 :param default_transaction_options: (Optional) Default options to use for all transactions.
178178
179+ :type experimental_host: str
180+ :param experimental_host: (Optional) The endpoint for a spanner experimental host deployment.
181+ This is intended only for experimental host spanner endpoints.
182+ If set, this will override the `api_endpoint` in `client_options`.
183+
179184 :raises: :class:`ValueError <exceptions.ValueError>` if both ``read_only``
180185 and ``admin`` are :data:`True`
181186 """
@@ -200,8 +205,10 @@ def __init__(
200205directed_read_options = None ,
201206observability_options = None ,
202207default_transaction_options : Optional [DefaultTransactionOptions ] = None ,
208+ experimental_host = None ,
203209 ):
204210self ._emulator_host = _get_spanner_emulator_host ()
211+ self ._experimental_host = experimental_host
205212
206213if client_options and type (client_options ) is dict :
207214self ._client_options = google .api_core .client_options .from_dict (
@@ -212,6 +219,8 @@ def __init__(
212219
213220if self ._emulator_host :
214221credentials = AnonymousCredentials ()
222+ elif self ._experimental_host :
223+ credentials = AnonymousCredentials ()
215224elif isinstance (credentials , AnonymousCredentials ):
216225self ._emulator_host = self ._client_options .api_endpoint
217226
@@ -324,6 +333,15 @@ def instance_admin_api(self):
324333client_options = self ._client_options ,
325334transport = transport ,
326335 )
336+ elif self ._experimental_host :
337+ transport = InstanceAdminGrpcTransport (
338+ channel = grpc .insecure_channel (target = self ._experimental_host )
339+ )
340+ self ._instance_admin_api = InstanceAdminClient (
341+ client_info = self ._client_info ,
342+ client_options = self ._client_options ,
343+ transport = transport ,
344+ )
327345else :
328346self ._instance_admin_api = InstanceAdminClient (
329347credentials = self .credentials ,
@@ -345,6 +363,15 @@ def database_admin_api(self):
345363client_options = self ._client_options ,
346364transport = transport ,
347365 )
366+ elif self ._experimental_host :
367+ transport = DatabaseAdminGrpcTransport (
368+ channel = grpc .insecure_channel (target = self ._experimental_host )
369+ )
370+ self ._database_admin_api = DatabaseAdminClient (
371+ client_info = self ._client_info ,
372+ client_options = self ._client_options ,
373+ transport = transport ,
374+ )
348375else :
349376self ._database_admin_api = DatabaseAdminClient (
350377credentials = self .credentials ,
@@ -485,6 +512,7 @@ def instance(
485512self ._emulator_host ,
486513labels ,
487514processing_units ,
515+ self ._experimental_host ,
488516 )
489517
490518def list_instances (self , filter_ = "" , page_size = None ):
0 commit comments