diff --git a/bigframes/functions/_function_session.py b/bigframes/functions/_function_session.py index 6d2f0dbd57..7fb5cc114b 100644 --- a/bigframes/functions/_function_session.py +++ b/bigframes/functions/_function_session.py @@ -740,9 +740,12 @@ def udf( BigQuery managed function. .. note:: - The udf must be self-contained, i.e. it must not contain any + This feature is in preview. The code in the udf must be + (1) self-contained, i.e. it must not contain any references to an import or variable defined outside the function - body. + body, and + (2) Python 3.11 compatible, as that is the environment + in which the code is executed in the cloud. .. note:: Please have following IAM roles enabled for you: @@ -801,7 +804,7 @@ def udf( https://pip.pypa.io/en/stable/reference/requirements-file-format/. """ - warnings.warn("udf is in preview.", category=bfe.PreviewWarning) + warnings.warn("udf is in preview.", category=bfe.PreviewWarning, stacklevel=5) # Some defaults may be used from the session if not provided otherwise. session = self._resolve_session(session) diff --git a/bigframes/session/__init__.py b/bigframes/session/__init__.py index 7229a4641b..b189c0e194 100644 --- a/bigframes/session/__init__.py +++ b/bigframes/session/__init__.py @@ -1426,9 +1426,12 @@ def udf( [BigQuery managed user-defined function](https://cloud.google.com/bigquery/docs/user-defined-functions-python). .. note:: - The udf must be self-contained, i.e. it must not contain any + This feature is in preview. The code in the udf must be + (1) self-contained, i.e. it must not contain any references to an import or variable defined outside the function - body. + body, and + (2) Python 3.11 compatible, as that is the environment + in which the code is executed in the cloud. .. note:: Please have BigQuery Data Editor (roles/bigquery.dataEditor) IAM