fix(proxy): change check_file_size_under_limit to accept Collection[str]

Fixes mypy type error where router_model_names (a set) was incompatible
with List[str] parameter type.

Changed check_file_size_under_limit to accept Collection[str] instead of
List[str] since the parameter is only used for membership checks, making
it more flexible and avoiding unnecessary type conversions.

Resolves: proxy/proxy_server.py:5107 arg-type error
This commit is contained in:
AlexsanderHamir
2025-10-16 14:42:27 -07:00
parent 220fa3feeb
commit aad0efd99a
@@ -1,6 +1,6 @@
import json
import re
from typing import Any, Dict, List, Optional
from typing import Any, Collection, Dict, List, Optional
import orjson
from fastapi import Request, UploadFile, status
@@ -149,7 +149,7 @@ def _safe_get_request_headers(request: Optional[Request]) -> dict:
def check_file_size_under_limit(
request_data: dict,
file: UploadFile,
router_model_names: List[str],
router_model_names: Collection[str],
) -> bool:
"""
Check if any files passed in request are under max_file_size_mb