mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-09 22:31:41 +00:00
fix(types): fix mypy errors in pass-through endpoint query param types
- passthrough/utils.py: change `request_query_params` from `Dict` to `Mapping` so callers passing `dict[str, str]` satisfy the type checker (dict is invariant; Mapping is covariant in its value type) - pass_through_endpoints.py: cast `param_default_query_params` to `Optional[dict]` consistent with the existing cast pattern for other params extracted from the untyped `target_params` dict Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
ec28395054
commit
f3003a9840
2 changed files with 3 additions and 3 deletions
|
|
@ -1,4 +1,4 @@
|
|||
from typing import Dict, List, Optional, Union
|
||||
from typing import Dict, List, Mapping, Optional, Union
|
||||
from urllib.parse import parse_qs
|
||||
|
||||
import httpx
|
||||
|
|
@ -10,7 +10,7 @@ class BasePassthroughUtils:
|
|||
@staticmethod
|
||||
def get_merged_query_parameters(
|
||||
existing_url: httpx.URL,
|
||||
request_query_params: Dict[str, Union[str, list]],
|
||||
request_query_params: Mapping[str, Union[str, list]],
|
||||
default_query_params: Optional[Dict[str, Union[str, list]]] = None
|
||||
) -> Dict[str, Union[str, List[str]]]:
|
||||
# Get the existing query params from the target URL
|
||||
|
|
|
|||
|
|
@ -1221,7 +1221,7 @@ def create_pass_through_route(
|
|||
forward_headers=cast(Optional[bool], param_forward_headers),
|
||||
merge_query_params=cast(Optional[bool], param_merge_query_params),
|
||||
query_params=final_query_params,
|
||||
default_query_params=param_default_query_params,
|
||||
default_query_params=cast(Optional[dict], param_default_query_params),
|
||||
stream=is_streaming_request or stream,
|
||||
custom_body=final_custom_body,
|
||||
cost_per_request=cast(Optional[float], param_cost_per_request),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue