@@ -237,6 +237,7 @@ def _try_delattr(self, func: Callable, attr: str) -> None:
237237 # https://github.com/ibis-project/ibis/blob/master/ibis/backends/bigquery/udf/__init__.py
238238 def remote_function (
239239 self ,
240+ * ,
240241 input_types : Union [None , type , Sequence [type ]] = None ,
241242 output_type : Optional [type ] = None ,
242243 session : Optional [Session ] = None ,
@@ -251,7 +252,7 @@ def remote_function(
251252 reuse : bool = True ,
252253 name : Optional [str ] = None ,
253254 packages : Optional [Sequence [str ]] = None ,
254- cloud_function_service_account : Optional [ str ] = None ,
255+ cloud_function_service_account : str ,
255256 cloud_function_kms_key_name : Optional [str ] = None ,
256257 cloud_function_docker_repository : Optional [str ] = None ,
257258 max_batching_rows : Optional [int ] = 1000 ,
@@ -384,8 +385,8 @@ def remote_function(
384385 Explicit name of the external package dependencies. Each dependency
385386 is added to the `requirements.txt` as is, and can be of the form
386387 supported in https://pip.pypa.io/en/stable/reference/requirements-file-format/.
387- cloud_function_service_account (str, Optional ):
388- Service account to use for the cloud functions. If not provided then
388+ cloud_function_service_account (str):
389+ Service account to use for the cloud functions. If "default" provided then
389390 the default service account would be used. See
390391 https://cloud.google.com/functions/docs/securing/function-identity
391392 for more details. Please make sure the service account has the
@@ -455,22 +456,12 @@ def remote_function(
455456 # Some defaults may be used from the session if not provided otherwise.
456457 session = self ._resolve_session (session )
457458
458- # raise a UserWarning if user does not explicitly set cloud_function_service_account to a
459- # user-managed cloud_function_service_account of to default
460- msg = bfe .format_message (
461- "You have not explicitly set a user-managed `cloud_function_service_account`. "
462- "Using the default Compute Engine service account. "
463- "In BigFrames 2.0 onwards, you would have to explicitly set `cloud_function_service_account` "
464- 'either to a user-managed service account (preferred) or to `"default"` '
465- "to use the default Compute Engine service account (discouraged). "
466- "See, https://cloud.google.com/functions/docs/securing/function-identity."
467- )
468-
459+ # If the user forces the cloud function service argument to None, throw
460+ # an exception
469461 if cloud_function_service_account is None :
470- warnings .warn (msg , stacklevel = 2 , category = FutureWarning )
471-
472- if cloud_function_service_account == "default" :
473- cloud_function_service_account = None
462+ raise ValueError (
463+ 'You must provide a user managed cloud_function_service_account, or "default" if you would like to let the default service account be used.'
464+ )
474465
475466 # A BigQuery client is required to perform BQ operations.
476467 bigquery_client = self ._resolve_bigquery_client (session , bigquery_client )
@@ -615,7 +606,9 @@ def wrapper(func):
615606 bq_connection_manager ,
616607 cloud_function_region ,
617608 cloud_functions_client ,
618- cloud_function_service_account ,
609+ None
610+ if cloud_function_service_account == "default"
611+ else cloud_function_service_account ,
619612 cloud_function_kms_key_name ,
620613 cloud_function_docker_repository ,
621614 session = session , # type: ignore
0 commit comments