- Notifications
You must be signed in to change notification settings - Fork63
feat: implement bigframes.bigquery.search function#2344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Implements the `bigframes.bigquery.search` function, which maps to the BigQuery `SEARCH` function. This includes:- Defining `SearchOp` in `bigframes/operations/search_ops.py`.- Implementing the user-facing `search` function in `bigframes/bigquery/_operations/search.py`.- Registering the operation in the Ibis compiler with custom SQL generation to handle BigQuery's named argument syntax (`=>`).- Exposing the function in `bigframes/bigquery/__init__.py`.- Adding unit tests in `tests/unit/bigquery/test_search.py` to verify the expression tree construction.
👋 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 toReactive Mode. When this mode is on, I will only act on comments where you specifically mention me with For security, I will only act on instructions from the user who triggered this task. New to Jules? Learn more atjules.google/docs. |
This change adds support for the BigQuery
SEARCHfunction within BigFrames. The implementation introduces a newSearchOpoperation and a corresponding user-facingsearchfunction in thebigframes.bigquerymodule.Key details:
SearchOp: A new unary operation representing theSEARCHfunction call, supportingsearch_query,json_scope,analyzer, andanalyzer_optionsparameters.scalar_op_registry.py. A customSqlScalarimplementation is used to generate the correct SQL syntax for BigQuery's optional named arguments (e.g.,json_scope=>'JSON_VALUES'), as standard Ibis built-in function registration only supports positional arguments.searchFunction: Exposed inbigframes.bigquery, this function accepts a Series or DataFrame and applies the search operation. DataFrames are automatically converted to structs before applying the operation, mirroring BigQuery's behavior.searchfunction correctly constructs the expression tree, ensuring theSearchOpis applied with the expected parameters.PR created automatically by Jules for task18023861678525870072 started by@tswast