Feature Request: Add Configurable Network Timeouts to HTTP Clients
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 56/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Tranquilla
- Stack tecnologico
- python
- Ambito
- backend-api-design
Direzione di ricerca
Start by locating the initialization methods for Client, AsyncClient, OauthClient, and AsyncOauthClient, then check how they construct or accept httpx clients. Trace the existing README.md examples and project tests for custom client behavior. Done means all four clients support the documented timeout setting, custom httpx client settings remain intact, and the updated examples are included.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The Problem
By default, the underlying httpx HTTP library used by this SDK applies a strict 5-second timeout to all network requests.
If an API method takes longer than 5 seconds to process-for example, generating a large PDF file, querying a heavy dataset, or doing operations over a slow network connection-the SDK will unexpectedly crash with a TimeoutException.
Currently, the only way for developers to fix this is to understand how httpx works underneath, build a custom httpx.Client() object with a custom timeout, and explicitly pass it into our SDK upon initialization. This is a bit too much boilerplate work for such a common requirement.
Proposed Solution
We should add a built-in timeout parameter directly into the initialization methods of all our clients (Client, AsyncClient, OauthClient, and AsyncOauthClient), giving it a safer default limit of 30.0 seconds.
Expected behavior:
# Before: Developers had to do all this
import httpx
custom_client = httpx.Client(timeout=60.0)
client = Client(token="abc", client=custom_client)
# After: Simple, clean SDK syntax
client = Client(token="abc", timeout=60.0)
Acceptance Criteria
- Add
timeout: float = 30.0toClientandAsyncClient. - Add
timeout: float = 30.0toOauthClientandAsyncOauthClient. - Pass this parameter into the underlying
httpxclient natively. - Ensure full backward compatibility—if a user manually passes a custom
httpxclient, their settings are preserved and not overridden. - Update
README.mdand PyPI docs with code examples showing how to configure the timeout. - Verify all existing unit tests pass cleanly.
Why this matters / Benefits
- Smarter Defaults: Bumping the default timeout from 5 to 30 seconds prevents the SDK from crashing during heavier, perfectly valid API workloads.
- Better Developer Experience (DX): Allows users to configure timeouts cleanly in one line of code without needing to learn the intricacies of the underlying
httpxlibrary.
- Lingua principale
- Python
- Stelle
- 18
- Fork
- 4
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di openapi/openapi-python-sdk
-
Rename package to openapi-sdk (PyPI approval in progress)Forse già presa @francescobianco l’ha presa 107 giorni fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 15/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
openapi/openapi-python-sdk#20 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
-
good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 55/100
openapi/openapi-python-sdk#9 · 7 commenti ·
Tutte le issue di openapi/openapi-python-sdk
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
-
[Bug]: Importing weave changes the process-wide localeForse già presa @himanshu748 l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
UX
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
mediajunkie/piper-morgan-product#2008 · 2 commenti ·