Skip to content

feat(bigframes): add ai.embed and ai.similarity to bigquery accessor - #17927

Open
sycai wants to merge 2 commits into
mainfrom
sycai_ai_embed_and_similarity
Open

feat(bigframes): add ai.embed and ai.similarity to bigquery accessor#17927
sycai wants to merge 2 commits into
mainfrom
sycai_ai_embed_and_similarity

Conversation

@sycai

@sycai sycai commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

I chose to define functions under the mixin instead of the code generator because of several function gaps.

We may onboard the ai functions to the code generator some day in the future. Tracking: b/540011825

Internal issue: b/517233441

@sycai
sycai requested review from a team as code owners July 28, 2026 18:50
@sycai
sycai requested review from GarrettWu and tswast and removed request for a team July 28, 2026 18:50

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request renames AITVFMixin to AIMixin and adds embed and similarity methods to the AIMixin class in series_mixins.py to support BigQuery AI embeddings and similarity calculations, along with corresponding unit tests. The review feedback highlights a shadowing issue in the new methods where the session parameter shadows the imported session module, which would cause failures when session is None. To resolve this, it is recommended to import bigframes at the module level and fall back to bigframes.session when the parameter is not provided.

Comment thread packages/bigframes/bigframes/extensions/core/series_mixins.py Outdated
Comment thread packages/bigframes/bigframes/extensions/core/series_mixins.py
Comment thread packages/bigframes/bigframes/extensions/core/series_mixins.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant