diff --git a/basedpyright-code-budget.json b/basedpyright-code-budget.json index 9b59480a0dc..0db61149249 100644 --- a/basedpyright-code-budget.json +++ b/basedpyright-code-budget.json @@ -57,7 +57,7 @@ "limit": 5601 }, "reportMissingTypeArgument": { - "limit": 15285 + "limit": 15284 }, "reportMissingTypeStubs": { "limit": 40 @@ -99,7 +99,7 @@ "limit": 0 }, "reportUnknownArgumentType": { - "limit": 44360 + "limit": 44149 }, "reportUnknownLambdaType": { "limit": 109 diff --git a/litellm/llms/milvus/vector_stores/grpc_transformation.py b/litellm/llms/milvus/vector_stores/grpc_transformation.py index 5a271ebe5f6..a3c3eecd2ff 100644 --- a/litellm/llms/milvus/vector_stores/grpc_transformation.py +++ b/litellm/llms/milvus/vector_stores/grpc_transformation.py @@ -184,7 +184,9 @@ class _MilvusSearchOptions(BaseModel): def result_limit(self) -> int: return self.max_num_results or self.limit - def output_fields_with_text(self, text_field: str) -> list[str]: + def output_fields_with_text( + self, text_field: str + ) -> list[str]: # mutable-ok: PyMilvus requires output_fields as a list output_fields: Final = self.output_fields or () if "*" in output_fields or text_field in output_fields: return list(output_fields) diff --git a/litellm/proxy/vector_store_endpoints/management_endpoints.py b/litellm/proxy/vector_store_endpoints/management_endpoints.py index cf381518c52..aaec82b3ea6 100644 --- a/litellm/proxy/vector_store_endpoints/management_endpoints.py +++ b/litellm/proxy/vector_store_endpoints/management_endpoints.py @@ -110,7 +110,7 @@ def _redact_sensitive_litellm_params(litellm_params: Any, _depth: int = 0) -> An def _validated_litellm_params( - litellm_params: dict[str, Any], + litellm_params: dict[str, Any], # mutable-ok: provider parameters arrive as a mutable request object ) -> dict[str, Any]: # mutable-ok: persistence validation returns a serializable parameter dict from litellm.types.router import GenericLiteLLMParams diff --git a/litellm/proxy/vector_store_endpoints/utils.py b/litellm/proxy/vector_store_endpoints/utils.py index 9f527aec467..a0b74435d57 100644 --- a/litellm/proxy/vector_store_endpoints/utils.py +++ b/litellm/proxy/vector_store_endpoints/utils.py @@ -72,7 +72,7 @@ def normalize_vector_store_provider(custom_llm_provider: object) -> str | None: try: _, provider, _, _ = litellm.get_llm_provider(model=custom_llm_provider) return provider - except Exception: + except Exception: # noqa: BLE001 # provider parsing failures fall back to the explicit prefix return custom_llm_provider.split("/", 1)[0] diff --git a/test-quality-budget.json b/test-quality-budget.json index 7ca563d25af..8f0ebb1ea92 100644 --- a/test-quality-budget.json +++ b/test-quality-budget.json @@ -21,6 +21,6 @@ "limit": 117 }, "TQ008": { - "limit": 11003 + "limit": 11000 } } diff --git a/tests/test_litellm/proxy/vector_store_endpoints/test_vector_store_endpoints.py b/tests/test_litellm/proxy/vector_store_endpoints/test_vector_store_endpoints.py index 9ce014fc719..72c53c9e7b9 100644 --- a/tests/test_litellm/proxy/vector_store_endpoints/test_vector_store_endpoints.py +++ b/tests/test_litellm/proxy/vector_store_endpoints/test_vector_store_endpoints.py @@ -686,8 +686,12 @@ def test_user_supplied_milvus_grpc_connection_requires_proxy_admin(): @pytest.mark.asyncio async def test_unmanaged_milvus_grpc_connection_requires_admin_after_provider_normalization(provider): with ( - patch.object(litellm, "vector_store_registry", None), - patch("litellm.proxy.proxy_server.prisma_client", None), + patch.object( # test-quality-ok: the endpoint reads the process-wide registry directly + litellm, "vector_store_registry", None + ), + patch( # test-quality-ok: the endpoint reads the proxy database singleton directly + "litellm.proxy.proxy_server.prisma_client", None + ), pytest.raises(HTTPException) as exc_info, ): await _update_request_data_with_litellm_managed_vector_store_registry( @@ -720,7 +724,9 @@ async def test_managed_milvus_uses_only_persisted_connection_for_non_admin(): mock_registry = MagicMock() mock_registry.get_litellm_managed_vector_store_from_registry.return_value = managed_vector_store - with patch.object(litellm, "vector_store_registry", mock_registry): + with patch.object( # test-quality-ok: the helper reads the process-wide registry directly + litellm, "vector_store_registry", mock_registry + ): result = await _update_request_data_with_litellm_managed_vector_store_registry( data={ "query": "safe", @@ -789,7 +795,9 @@ async def test_config_loaded_milvus_grpc_connection_is_trusted(): ] ) - with patch.object(litellm, "vector_store_registry", registry): + with patch.object( # test-quality-ok: config trust is established by the process-wide registry + litellm, "vector_store_registry", registry + ): result = await _update_request_data_with_litellm_managed_vector_store_registry( data={"query": "allowed"}, vector_store_id="configured", @@ -884,7 +892,9 @@ async def test_config_vector_store_id_cannot_be_created_in_database(): prisma_client = MagicMock() with ( - patch.object(litellm, "vector_store_registry", registry), + patch.object( # test-quality-ok: create checks collisions against the process-wide registry + litellm, "vector_store_registry", registry + ), pytest.raises(HTTPException, match="defined in proxy configuration") as exc_info, ): await create_vector_store_in_db( @@ -908,9 +918,13 @@ async def test_config_vector_store_id_cannot_be_updated_in_database(): prisma_client = MagicMock() with ( - patch.object(litellm, "vector_store_registry", registry), - patch("litellm.proxy.proxy_server.prisma_client", prisma_client), - patch( + patch.object( # test-quality-ok: update checks collisions against the process-wide registry + litellm, "vector_store_registry", registry + ), + patch( # test-quality-ok: the endpoint reads the proxy database singleton directly + "litellm.proxy.proxy_server.prisma_client", prisma_client + ), + patch( # test-quality-ok: feature entitlement is outside the collision behavior "litellm.proxy.vector_store_endpoints.management_endpoints.check_feature_access_for_user", new=AsyncMock(), ), diff --git a/type-discipline-budget.json b/type-discipline-budget.json index 8589a9451cf..23d4efa3202 100644 --- a/type-discipline-budget.json +++ b/type-discipline-budget.json @@ -1,6 +1,6 @@ { "LIT001": { - "limit": 22328 + "limit": 22327 }, "LIT002": { "limit": 26748