fix: add mypy type ignore for union-attr on callback.async_close

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jaeyeon Kim 2026-03-21 02:24:16 +09:00
parent 12e4ffa39c
commit 32c60e71cf

View file

@ -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}"