googleapis / googleapis/python-genai

DeprecationWarning: Inheritance class AiohttpClientSession from ClientSession is discouraged

Aperta
#1,989 3 commenti 4 reazioni 1 assegnatario Rivendicata da @Venkaiahbabuneelam Vedi su GitHub
priority: p2 type: bug
Lingua principale
Python
Stelle
4k
Fork
1k
Merge medio
2g 12h
PR unite (30g)
41

Descrizione

#### 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.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.