Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

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

Geschlossen Anfängerfreundlich
#7,415 2 Kommentare 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

Maintainer antworten meist innerhalb von 5 Tagen

@llalitkumarrr arbeitet bereits daran.

Seit 06.10.2026.

  • #7417 von @a2105z — offen

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
74/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
python
Bereich
backend

Rechercherichtung

Lies src/google/adk/dependencies/vertexai.py und überprüfe die Importe auf Modulebene. Untersuche anschließend evaluation/vertex_ai_eval_facade.py und tools/retrieval/vertex_ai_rag_retrieval.py, um zu verstehen, welcher Code RAG benötigt. Führe den Reproduktionsbefehl mit als Fehler behandelten Warnungen aus. Fertig ist es, wenn das Importieren der Evaluation-Fassade keine Ausnahme mehr auslöst und keine RAG-Veraltungswarnung mehr ausgibt, während die RAG-Funktionalität weiterhin verfügbar ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
Python
Sterne
21.8k
Forks
4.1k
Ø Merge
3 T. 39 Min.
Gemergte PRs (30 T.)
7

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus google/adk-python

Alle Issues in google/adk-python

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.