From 32c60e71cfa9b4bda77bcf713865349b64acf886 Mon Sep 17 00:00:00 2001 From: Jaeyeon Kim Date: Sat, 21 Mar 2026 02:24:16 +0900 Subject: [PATCH] fix: add mypy type ignore for union-attr on callback.async_close Co-Authored-By: Claude Opus 4.6 (1M context) --- litellm/proxy/proxy_server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index cbe145a4514..f4eac4d0b5f 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -976,9 +976,9 @@ async def proxy_startup_event(app: FastAPI): # noqa: PLR0915 # Shutdown event - close guardrail/callback resources (e.g. presidio aiohttp sessions) for callback in litellm.callbacks: - if hasattr(callback, "async_close") and callable(callback.async_close): + if hasattr(callback, "async_close") and callable(callback.async_close): # type: ignore[union-attr] try: - await callback.async_close() + await callback.async_close() # type: ignore[union-attr] except Exception as e: verbose_proxy_logger.error( f"Error closing callback {type(callback).__name__}: {e}"