Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

Added bigframes.bigquery.rand() function to bigframes/bigquery/_operations/mathematical.py and exposed it in bigframes/bigquery/__init__.py.
The function generates random float values in [0, 1).
Added unit tests and system tests.


PR created automatically by Jules for task 2516630488154236828 started by @tswast

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.
Tests are added in `tests/unit/bigquery/test_mathematical.py` and `tests/system/small/bigquery/test_mathematical.py`.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. labels Jan 20, 2026
@tswast tswast changed the title Add bigframes.bigquery.rand() function feat: Add bigframes.bigquery.rand() function Jan 20, 2026
@tswast tswast marked this pull request as ready for review January 20, 2026 17:34
@tswast tswast requested review from a team as code owners January 20, 2026 17:35
@tswast tswast requested a review from TrevorBergeron January 20, 2026 17:35
@tswast tswast added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 20, 2026
tswast
tswast previously approved these changes Jan 20, 2026
@bigframes-bot bigframes-bot removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 20, 2026
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`.
@tswast tswast added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 20, 2026
@bigframes-bot bigframes-bot removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants