From f72e1828cb54a21c748744b8cb62eb754f73f026 Mon Sep 17 00:00:00 2001 From: jialuo Date: Thu, 10 Apr 2025 18:42:49 +0000 Subject: [PATCH 1/5] chore: add details for bigquery_connection in udf docstring --- bigframes/functions/_function_session.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bigframes/functions/_function_session.py b/bigframes/functions/_function_session.py index b0d3ab81eb..aa20fe7a16 100644 --- a/bigframes/functions/_function_session.py +++ b/bigframes/functions/_function_session.py @@ -775,6 +775,8 @@ def udf( Name of the BigQuery connection. It is used to provide an identity to the serverless instances running the user code. It helps BigQuery manage and track the resources used by the udf. + When it defaults to None, the UDF will be created without + referencing a specific connection in its BigQuery DDL. name (str, Optional): Explicit name of the persisted BigQuery managed function. Use it with caution, because more than one users working in the same From 43fbc100cd15c1790a937a82a1ba195cbbb2d86e Mon Sep 17 00:00:00 2001 From: jialuo Date: Thu, 10 Apr 2025 18:45:08 +0000 Subject: [PATCH 2/5] quick fix --- bigframes/functions/_function_session.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bigframes/functions/_function_session.py b/bigframes/functions/_function_session.py index aa20fe7a16..c117466453 100644 --- a/bigframes/functions/_function_session.py +++ b/bigframes/functions/_function_session.py @@ -775,7 +775,7 @@ def udf( Name of the BigQuery connection. It is used to provide an identity to the serverless instances running the user code. It helps BigQuery manage and track the resources used by the udf. - When it defaults to None, the UDF will be created without + When it defaults to None, the udf will be created without referencing a specific connection in its BigQuery DDL. name (str, Optional): Explicit name of the persisted BigQuery managed function. Use it From 942efb773acb9e126b880b2f5c117e2f3034eb21 Mon Sep 17 00:00:00 2001 From: jialuoo Date: Fri, 11 Apr 2025 10:58:04 -0700 Subject: [PATCH 3/5] Update bigframes/functions/_function_session.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Tim Sweña (Swast) --- bigframes/functions/_function_session.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bigframes/functions/_function_session.py b/bigframes/functions/_function_session.py index c117466453..0a018e9d26 100644 --- a/bigframes/functions/_function_session.py +++ b/bigframes/functions/_function_session.py @@ -776,7 +776,8 @@ def udf( identity to the serverless instances running the user code. It helps BigQuery manage and track the resources used by the udf. When it defaults to None, the udf will be created without - referencing a specific connection in its BigQuery DDL. + any connection. A udf without a connection has no + internet access and no access to other GCP services. name (str, Optional): Explicit name of the persisted BigQuery managed function. Use it with caution, because more than one users working in the same From 3869c79b49d009fa3b3357bc888a806485815ca5 Mon Sep 17 00:00:00 2001 From: jialuo Date: Fri, 11 Apr 2025 18:19:52 +0000 Subject: [PATCH 4/5] resolve the comments --- bigframes/functions/_function_session.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bigframes/functions/_function_session.py b/bigframes/functions/_function_session.py index 0a018e9d26..dba03029c8 100644 --- a/bigframes/functions/_function_session.py +++ b/bigframes/functions/_function_session.py @@ -775,9 +775,13 @@ def udf( Name of the BigQuery connection. It is used to provide an identity to the serverless instances running the user code. It helps BigQuery manage and track the resources used by the udf. - When it defaults to None, the udf will be created without - any connection. A udf without a connection has no - internet access and no access to other GCP services. + This connection is required for internet access and for + interacting with other GCP services. To access GCP services, the + appropriate IAM permissions must also be granted to the + connection's Service Account. When it defaults to None, the udf + will be created without any connection. A udf without a + connection has no internet access and no access to other GCP + services. name (str, Optional): Explicit name of the persisted BigQuery managed function. Use it with caution, because more than one users working in the same From d456bdaa6ba692ddec76b34227fe162978a08dc6 Mon Sep 17 00:00:00 2001 From: jialuo Date: Fri, 11 Apr 2025 18:28:28 +0000 Subject: [PATCH 5/5] sync the docstring --- bigframes/session/__init__.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/bigframes/session/__init__.py b/bigframes/session/__init__.py index 72f6fb9b5d..c062b1cbe3 100644 --- a/bigframes/session/__init__.py +++ b/bigframes/session/__init__.py @@ -1513,12 +1513,16 @@ def udf( format. If this parameter is not provided then session dataset id is used. bigquery_connection (str, Optional): - Name of the BigQuery connection. You should either have the - connection already created in the `location` you have chosen, or - you should have the Project IAM Admin role to enable the service - to create the connection for you if you need it. If this - parameter is not provided then the BigQuery connection from the - session is used. + Name of the BigQuery connection. It is used to provide an + identity to the serverless instances running the user code. It + helps BigQuery manage and track the resources used by the udf. + This connection is required for internet access and for + interacting with other GCP services. To access GCP services, the + appropriate IAM permissions must also be granted to the + connection's Service Account. When it defaults to None, the udf + will be created without any connection. A udf without a + connection has no internet access and no access to other GCP + services. name (str, Optional): Explicit name of the persisted BigQuery managed function. Use it with caution, because more than one users working in the same