Skip to content

fix(evaluation): stop loading deprecated Vertex RAG on eval import - #7417

Closed
a2105z wants to merge 1 commit into
google:mainfrom
a2105z:fix/lazy-vertexai-rag-import
Closed

a2105z wants to merge 1 commit into
google:mainfrom
a2105z:fix/lazy-vertexai-rag-import

Conversation

@a2105z

@a2105z a2105z commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Please ensure you have read the contribution guide before creating a pull request.

Link to Issue or Description of Change

1. Link to an existing issue (if applicable):

Problem:
google-cloud-aiplatform 1.163+ deprecates vertexai.preview.rag and emits a UserWarning on every import. Evaluation only needs vertexai itself, but google.adk.dependencies.vertexai imported RAG at module load, so import google.adk.evaluation.vertex_ai_eval_facade warned even when RAG was unused.

Solution:
Drop the eager RAG import from the Vertex helper, keep example_stores, and let VertexAiRagRetrieval.run_async import vertexai.preview.rag only when a non-Gemini model actually runs the tool. This does not migrate to the agentplatform client.

Testing Plan

Unit Tests:

  • I have added or updated unit tests for my change.
  • All unit tests pass locally.
uv run --extra test python -m pytest tests/unittests/dependencies/test_vertexai.py tests/unittests/tools/retrieval/test_vertex_ai_rag_retrieval.py tests/unittests/evaluation/test_vertex_ai_eval_facade.py tests/unittests/examples/test_vertex_ai_example_store.py -q
34 passed

Isolated reproduction from #7415 now succeeds:

uv run --extra test python -W error::UserWarning -c "import google.adk.evaluation.vertex_ai_eval_facade"

Manual End-to-End (E2E) Tests:

N/A — this is an import-side-effect fix. Covered by the isolated import check and unit tests above.

Checklist

  • I have read the CONTRIBUTING.md document.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have manually tested my changes end-to-end.
  • Any dependent changes have been merged and published in downstream modules.

Additional context

@roanny this follows the spec from #7415: drop the eager RAG import, keep example_stores, and leave the agentplatform migration for a later change.

Made with Cursor

google-cloud-aiplatform 1.163+ warns on vertexai.preview.rag. Evaluation
only needs vertexai itself, so the helper no longer imports RAG at module
load. The retrieval tool still loads it inside run_async.

Fixes google#7415
@GWeale

GWeale commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

thanks @a2105z, this landed as 6854b88 but github didn't close the pr. it's on main, not in a release yet. please open a new issue if this is still happening.

@GWeale GWeale closed this Oct 7, 2026
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.

dependencies/vertexai.py eagerly imports the deprecated vertexai.preview.rag, so every evaluation import warns

3 participants