Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

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

Aberta Para iniciantes
#7,415 2 comentários 0 reações 1 responsável Ver no GitHub

Mantenedores costumam responder em até 6 dias

@llalitkumarrr já está trabalhando nisso.

Desde 6/10/2026.

  • #7417 de @a2105z — aberto

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
74/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
python
Domínio
backend

Direção de pesquisa

Leia src/google/adk/dependencies/vertexai.py e verifique as importações no nível do módulo. Em seguida, inspecione evaluation/vertex_ai_eval_facade.py e tools/retrieval/vertex_ai_rag_retrieval.py para entender qual código precisa de RAG. Execute o comando de reprodução tratando os avisos como erros. O trabalho estará concluído quando importar a facade de avaliação não gerar mais uma exceção nem emitir o aviso de descontinuação do RAG, enquanto a funcionalidade de RAG continuar disponível.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Required Information

Describe the Bug:
google/adk/dependencies/vertexai.py imports vertexai.preview.rag at module level. Since google-cloud-aiplatform deprecated that module, the import emits a UserWarning on load. Every ADK module that imports anything from ..dependencies.vertexai therefore triggers it, even when it only needs vertexai itself. That includes evaluation/vertex_ai_eval_facade.py:29 (from ..dependencies.vertexai import vertexai) and the other evaluation modules. As a result, every AgentEvaluator / adk eval run prints the deprecation warning, although no RAG code is used. Under -W error::UserWarning (or filterwarnings = error in pytest) the import fails.

The code is unchanged on main (d4e092e997): src/google/adk/dependencies/vertexai.py:19 still reads from vertexai.preview import rag as rag.

Steps to Reproduce:

  1. pip install "google-adk[eval]==2.11.0" "google-cloud-aiplatform==1.163.0".
  2. python -W error::UserWarning -c "import google.adk.evaluation.vertex_ai_eval_facade"

Expected Behavior:
Importing ADK's evaluation modules emits no deprecation warning for a module they do not use. The RAG import should happen only where RAG is used (tools/retrieval/vertex_ai_rag_retrieval.py already imports it only under TYPE_CHECKING, line 35, and inside the call, line 103), or move to the replacement client.

Observed Behavior:

  File ".../google/adk/evaluation/vertex_ai_eval_facade.py", line 29, in <module>
  File ".../google/adk/dependencies/vertexai.py", line 19, in <module>
  File ".../vertexai/preview/rag/__init__.py", line 186, in <module>
UserWarning: The `vertexai.preview.rag` module is deprecated and will be removed in a future version. Please migrate to the `agentplatform` client. For example:

    import agentplatform

    client = agentplatform.Client(project="your-project", location="us-central1")
    client.rag.create_corpus(...)

Without -W error, the same warning appears in pytest's warnings summary of every evaluation test.

Environment Details:

  • ADK Library Version: 2.11.0 (code identical on main d4e092e997)
  • Desktop OS: macOS 27.2
  • Python Version: 3.12.8

Model Information:

  • Are you using LiteLLM: No
  • Which model is being used: N/A (import-time behaviour)

Optional Information

Regression:
The ADK code is not new. The warning appears with google-cloud-aiplatform 1.163.0, which deprecates vertexai.preview.rag. Once that module is removed, the import in dependencies/vertexai.py would fail outright, taking the evaluation modules with it.

Possible fix:
Drop the eager from vertexai.preview import rag from dependencies/vertexai.py. Let the RAG retrieval tool import vertexai.preview.rag inside the call, where it already defers the import, or migrate it to the agentplatform client the deprecation message names. example_stores, imported the same way, emits no warning today.

Linguagem predominante
Python
Estrelas
21.6k
Forks
4k
Merge médio
9h 59min
PRs com merge (30d)
5

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de google/adk-python

Todas as issues de google/adk-python

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.