Skip to content

Commit

Permalink
πŸ§‘β€πŸ’» Forbid extra arguments when _http_client was passed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphael Krupinski committed Mar 31, 2024
1 parent 22b5f65 commit 18d1aa6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lapidary/runtime/client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ def __init__(
_http_client: Optional[httpx.AsyncClient] = None,
**httpx_kwargs,
):
if httpx_kwargs and _http_client:
raise TypeError(f'Extra keyword arguments not accepted when passing _http_client: {", ".join(httpx_kwargs.keys())}')

headers = httpx.Headers(httpx_kwargs.pop('headers', None)) or httpx.Headers()
if user_agent:
headers['User-Agent'] = user_agent
Expand Down

0 comments on commit 18d1aa6

Please sign in to comment.