@@ -249,20 +249,19 @@ def __init__(
249
249
bq_host = _get_bigquery_host ()
250
250
kw_args ["api_endpoint" ] = bq_host if bq_host != _DEFAULT_HOST else None
251
251
client_universe = None
252
- if client_options :
253
- if isinstance (client_options , dict ):
254
- client_options = google .api_core .client_options .from_dict (
255
- client_options
252
+ if client_options is None :
253
+ client_options = {}
254
+ if isinstance (client_options , dict ):
255
+ client_options = google .api_core .client_options .from_dict (client_options )
256
+ if client_options .api_endpoint :
257
+ api_endpoint = client_options .api_endpoint
258
+ kw_args ["api_endpoint" ] = api_endpoint
259
+ else :
260
+ client_universe = _get_client_universe (client_options )
261
+ if client_universe != _DEFAULT_UNIVERSE :
262
+ kw_args ["api_endpoint" ] = _DEFAULT_HOST_TEMPLATE .replace (
263
+ "{UNIVERSE_DOMAIN}" , client_universe
256
264
)
257
- if client_options .api_endpoint :
258
- api_endpoint = client_options .api_endpoint
259
- kw_args ["api_endpoint" ] = api_endpoint
260
- else :
261
- client_universe = _get_client_universe (client_options )
262
- if client_universe != _DEFAULT_UNIVERSE :
263
- kw_args ["api_endpoint" ] = _DEFAULT_HOST_TEMPLATE .replace (
264
- "{UNIVERSE_DOMAIN}" , client_universe
265
- )
266
265
# Ensure credentials and universe are not in conflict.
267
266
if hasattr (self , "_credentials" ) and client_universe is not None :
268
267
_validate_universe (client_universe , self ._credentials )
0 commit comments