googleapis / googleapis/python-genai

DeprecationWarning: Inheritance class AiohttpClientSession from ClientSession is discouraged

Offen
#1,989 3 Kommentare 4 Reaktionen 1 zugewiesene Person Beansprucht von @Venkaiahbabuneelam Auf GitHub ansehen
priority: p2 type: bug
Vorherrschende Sprache
Python
Sterne
4k
Forks
1k
Ø Merge
2 T. 12 Std.
Gemergte PRs (30 T.)
41

Beschreibung

#### Environment details

- Programming language: `Python`
- OS: `Ubuntu 24.04.3 LTS`
- Language runtime version: `3.13.11`
- Package version: `1.60.0`

#### Steps to reproduce

1. Have `warnings.filterwarnings("error")` so that they get raised
2. Execute the following code
```py
warnings.filterwarnings("error")

gemini = Client(api_key=config_lookup("RANDOM_KEY"))
response = asyncio.run(
gemini.aio.models.generate_content(
model="gemini-2.5-flash",
contents="What is the capital of France?",
config=types.GenerateContentConfig(
thinking_config=types.ThinkingConfig(thinking_budget=0), # Disables thinking
),
)
)

print(response)
```
3. The following will get raised `DeprecationWarning: Inheritance class AiohttpClientSession from ClientSession is discouraged`

In our development environment, we also make sure to raise warnings as errors since we want to be aware of possible issues, like the one mentioned above.

As far as I can see, this particular Deprecation seems to have been in effect from 2018, [issue here](https://github.com/aio-libs/aiohttp/pull/2692)

For now our fix was to ignore the error, but it would probably be best to take care of it.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

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