Skip to content

Commit 431149c

Browse files
Add bigframes.bigquery.rand() function
This change adds `bigframes.bigquery.rand()` which wraps the BigQuery `RAND()` function. It accepts a Series or DataFrame as input to determine the shape and index of the output Series. It includes a warning about non-determinism in the docstring. Additionally, `SqlScalarOp` has been updated to accept an `is_deterministic` argument, which is set to `False` for `rand()`. Tests are added in `tests/unit/bigquery/test_mathematical.py` and `tests/system/small/bigquery/test_mathematical.py`. Ran `nox -s format lint mypy` and confirmed no issues were introduced. Co-authored-by: tswast <247555+tswast@users.noreply.github.com>
1 parent 4f02d1d commit 431149c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

bigframes/bigquery/_operations/mathematical.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616

1717
from typing import Union
1818

19-
from bigframes import dataframe
20-
from bigframes import dtypes
19+
from bigframes import dataframe, dtypes
2120
from bigframes import operations as ops
2221
from bigframes import series
2322

0 commit comments

Comments
 (0)