File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed
Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -245,10 +245,6 @@ def init(
245245 # Set api_transport as "rest" if location is "global".
246246 if location == "global" and not api_transport :
247247 self ._api_transport = "rest"
248- elif location == "global" and api_transport == "grpc" :
249- raise ValueError (
250- "api_transport cannot be 'grpc' when location is 'global'."
251- )
252248 if experiment_description and experiment is None :
253249 raise ValueError (
254250 "Experiment needs to be set in `init` in order to add experiment"
Original file line number Diff line number Diff line change @@ -306,10 +306,16 @@ def test_create_client_with_global_location(self):
306306 assert client ._transport ._host == f"https://{ constants .API_BASE_PATH } "
307307
308308 def test_create_client_with_global_location_and_grpc_transport (self ):
309- with pytest .raises (ValueError ):
310- initializer .global_config .init (
311- project = _TEST_PROJECT , location = "global" , api_transport = "grpc"
312- )
309+ initializer .global_config .init (
310+ project = _TEST_PROJECT , location = "global" , api_transport = "grpc"
311+ )
312+ client = initializer .global_config .create_client (
313+ client_class = utils .PredictionClientWithOverride
314+ )
315+ assert initializer .global_config .location == "global"
316+ assert initializer .global_config ._api_transport == "grpc"
317+ assert isinstance (client , utils .PredictionClientWithOverride )
318+ assert client ._transport ._host == f"{ constants .API_BASE_PATH } :443"
313319
314320 def test_create_client_with_api_key_and_grpc_transport (self ):
315321 with pytest .raises (ValueError ):
You can’t perform that action at this time.
0 commit comments