Skip to content

Commit 48d10d1

Browse files
authored
docs: note that udf is in preview and must be python 3.11 compatible (#1629)
* docs: note that `udf` is in preview and must be python 3.11 compatible * user stacklevel=5 to optimize the warning for bpd.udf entry point
1 parent 28afa2c commit 48d10d1

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

bigframes/functions/_function_session.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -740,9 +740,12 @@ def udf(
740740
BigQuery managed function.
741741
742742
.. note::
743-
The udf must be self-contained, i.e. it must not contain any
743+
This feature is in preview. The code in the udf must be
744+
(1) self-contained, i.e. it must not contain any
744745
references to an import or variable defined outside the function
745-
body.
746+
body, and
747+
(2) Python 3.11 compatible, as that is the environment
748+
in which the code is executed in the cloud.
746749
747750
.. note::
748751
Please have following IAM roles enabled for you:
@@ -801,7 +804,7 @@ def udf(
801804
https://pip.pypa.io/en/stable/reference/requirements-file-format/.
802805
"""
803806

804-
warnings.warn("udf is in preview.", category=bfe.PreviewWarning)
807+
warnings.warn("udf is in preview.", category=bfe.PreviewWarning, stacklevel=5)
805808

806809
# Some defaults may be used from the session if not provided otherwise.
807810
session = self._resolve_session(session)

bigframes/session/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,9 +1426,12 @@ def udf(
14261426
[BigQuery managed user-defined function](https://cloud.google.com/bigquery/docs/user-defined-functions-python).
14271427
14281428
.. note::
1429-
The udf must be self-contained, i.e. it must not contain any
1429+
This feature is in preview. The code in the udf must be
1430+
(1) self-contained, i.e. it must not contain any
14301431
references to an import or variable defined outside the function
1431-
body.
1432+
body, and
1433+
(2) Python 3.11 compatible, as that is the environment
1434+
in which the code is executed in the cloud.
14321435
14331436
.. note::
14341437
Please have BigQuery Data Editor (roles/bigquery.dataEditor) IAM

0 commit comments

Comments
 (0)