@@ -237,6 +237,7 @@ def _try_delattr(self, func: Callable, attr: str) -> None:
237
237
# https://github.com/ibis-project/ibis/blob/master/ibis/backends/bigquery/udf/__init__.py
238
238
def remote_function (
239
239
self ,
240
+ * ,
240
241
input_types : Union [None , type , Sequence [type ]] = None ,
241
242
output_type : Optional [type ] = None ,
242
243
session : Optional [Session ] = None ,
@@ -251,7 +252,7 @@ def remote_function(
251
252
reuse : bool = True ,
252
253
name : Optional [str ] = None ,
253
254
packages : Optional [Sequence [str ]] = None ,
254
- cloud_function_service_account : Optional [ str ] = None ,
255
+ cloud_function_service_account : str ,
255
256
cloud_function_kms_key_name : Optional [str ] = None ,
256
257
cloud_function_docker_repository : Optional [str ] = None ,
257
258
max_batching_rows : Optional [int ] = 1000 ,
@@ -384,8 +385,8 @@ def remote_function(
384
385
Explicit name of the external package dependencies. Each dependency
385
386
is added to the `requirements.txt` as is, and can be of the form
386
387
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
389
390
the default service account would be used. See
390
391
https://cloud.google.com/functions/docs/securing/function-identity
391
392
for more details. Please make sure the service account has the
@@ -455,22 +456,12 @@ def remote_function(
455
456
# Some defaults may be used from the session if not provided otherwise.
456
457
session = self ._resolve_session (session )
457
458
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
469
461
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
+ )
474
465
475
466
# A BigQuery client is required to perform BQ operations.
476
467
bigquery_client = self ._resolve_bigquery_client (session , bigquery_client )
@@ -615,7 +606,9 @@ def wrapper(func):
615
606
bq_connection_manager ,
616
607
cloud_function_region ,
617
608
cloud_functions_client ,
618
- cloud_function_service_account ,
609
+ None
610
+ if cloud_function_service_account == "default"
611
+ else cloud_function_service_account ,
619
612
cloud_function_kms_key_name ,
620
613
cloud_function_docker_repository ,
621
614
session = session , # type: ignore
0 commit comments