From df144e6a65d9a28ac3ebda5fbda0e8bb5afee8f1 Mon Sep 17 00:00:00 2001 From: "devin-ai-integration[bot]" <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 4 Nov 2026 16:21:40 +0000 Subject: [PATCH] fix(proxy): read the statement_timeout probe row without an untyped default --- litellm/proxy/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/proxy/utils.py b/litellm/proxy/utils.py index 8e4724629c9..543213c40ab 100644 --- a/litellm/proxy/utils.py +++ b/litellm/proxy/utils.py @@ -5337,7 +5337,7 @@ async def _lower_statement_timeout(transaction: _RawReadTransaction, timeout_ms: rows: Final = await transaction.query_raw( "SELECT setting::int AS ms FROM pg_settings WHERE name = 'statement_timeout'" ) - current_ms: Final = _STATEMENT_TIMEOUT_MS.validate_python(next(iter(rows), {}).get("ms", 0)) + current_ms: Final = _STATEMENT_TIMEOUT_MS.validate_python(rows[0].get("ms", 0) if rows else 0) if 0 < current_ms <= timeout_ms: return current_ms await transaction.execute_raw(f"SET LOCAL statement_timeout = {timeout_ms}")