Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

refactor(proxy): drop redundant docstrings from upload allowlist helpers and tests

yassince0301c23f06
diff --git a/litellm/proxy/openai_files_endpoints/general_upload_validation.py b/litellm/proxy/openai_files_endpoints/general_upload_validation.py
index 22f34b8bd87..e9b6c319fe5 100644
--- a/litellm/proxy/openai_files_endpoints/general_upload_validation.py
+++ b/litellm/proxy/openai_files_endpoints/general_upload_validation.py
@@ -32,10 +32,6 @@ def coerce_optional_int_setting(raw: object) -> int | None:
def coerce_optional_str_list_setting(raw: object) -> tuple[str, ...] | None:
- """A general_settings value declared as an optional list of strings, e.g. allowed_file_extensions.
-
- None (unset) and [] (set to nothing) are different answers for an allowlist, so both survive.
- """
if raw is None:
return None
if not isinstance(raw, list) or not all(isinstance(item, str) for item in raw):
@@ -104,7 +100,6 @@ def check_allowed_extension(
filename: str | None,
allowed_extensions: tuple[str, ...] | None,
) -> UploadedFileExtensionNotAllowed | None:
- """None means the allowlist is not configured; an empty tuple means nothing is allowed."""
if allowed_extensions is None:
return None
extension: Final = _normalized_extension(filename)
diff --git a/tests/test_litellm/proxy/openai_files_endpoint/test_files_endpoint.py b/tests/test_litellm/proxy/openai_files_endpoint/test_files_endpoint.py
index bd3aafd7865..5d8222162a2 100644
--- a/tests/test_litellm/proxy/openai_files_endpoint/test_files_endpoint.py
+++ b/tests/test_litellm/proxy/openai_files_endpoint/test_files_endpoint.py
@@ -4776,7 +4776,6 @@ def test_create_file_empty_allowlist_rejects_every_upload(monkeypatch, llm_route
def test_create_file_allowlist_runs_before_blocklist(monkeypatch, llm_router: Router):
- """An extension in both lists is refused by the allowlist message, and the blocklist still holds on its own."""
import litellm.proxy.proxy_server as ps
forwarded_calls = _setup_batch_upload_endpoint(monkeypatch, llm_router)
diff --git a/tests/test_litellm/proxy/openai_files_endpoint/test_general_upload_validation.py b/tests/test_litellm/proxy/openai_files_endpoint/test_general_upload_validation.py
index f5b558f3334..b742e1aa9b6 100644
--- a/tests/test_litellm/proxy/openai_files_endpoint/test_general_upload_validation.py
+++ b/tests/test_litellm/proxy/openai_files_endpoint/test_general_upload_validation.py
@@ -104,7 +104,6 @@ def test_allowed_extension_match_is_case_insensitive_for_configured_value():
@pytest.mark.parametrize("filename", ["README", "", None, "../../"])
def test_no_extension_rejected_when_allowlist_set(filename):
- """The allowlist grants by extension, so a name that yields none has nothing to be granted for."""
assert check_allowed_extension(filename, (".jsonl",)) == UploadedFileExtensionNotAllowed(extension="")