Missing aiohttp version constraint causes AttributeError for ClientConnectorDNSError
envgap__googleapis__python-genai-2016
01 / FAILURE SIGNATURE
As reported upstream
AttributeError: module aiohttp has no attribute ClientConnectorDNSError
Not a benchmark task.
- The project already builds and runs before the fix, so there is nothing to repair.
02 / ENVIRONMENT RECIPE
- Base commit
fafc3d80179d642a4adf4bce42e05a0045f8c1be- Manifest
pyproject.toml- Reproduce
Awaiting issue-specific recipe- Run under trace
Awaiting a meaningful runtime command
03 / ORIGINAL ISSUE TEXT
googleapis/python-genai #2016 · read the original issue
## Description
The `google-genai` package uses `aiohttp.ClientConnectorDNSError` in `_api_client.py`, but does not declare a minimum version constraint for `aiohttp`. This causes an `AttributeError` when an older version of `aiohttp` is installed transitively through another dependency.
`ClientConnectorDNSError` was introduced in aiohttp 3.10.11 (see [aiohttp changelog](https://docs.aiohttp.org/en/stable/changes.html#id24)).
## Error
```
File "/home/ray/anaconda3/lib/python3.11/site-packages/google/genai/_api_client.py", line 1242, in _async_request_once
aiohttp.ClientConnectorDNSError,
File "/home/ray/anaconda3/lib/python3.11/site-packages/aiohttp/__init__.py", line 240, in __getattr__
raise AttributeError(f"module {__name__} has no attribute {name}")
AttributeError: module aiohttp has no attribute ClientConnectorDNSError
```
## Expected Behavior
The package should explicitly declare `aiohttp>=3.10.11` (or `>3.10.10`) in its dependencies to ensure the required `ClientConnectorDNSError` class is available.
## Reproduction
1. Install `google-genai` in an environment where `aiohttp<3.10.11` is already installed as a transitive dependency
2. Make an async API call that triggers the retry logic in `_api_client.py`
3. The import of `aiohttp.ClientConnectorDNSError` fails
## Suggested Fix
Add a minimum version constraint to the `aiohttp` dependency in `pyproject.toml`:
```toml
aiohttp = ">=3.10.11"
```
## Environment
- Python 3.11
- google-genai 1.60.0
- aiohttp < 3.10.11 (installed transitively)04 / LABELS
Labels from the report text only; not yet run
No supported category has been assigned.
Label rules and the text that matched
[]