From 0598ab698b512f173ddcb6defe2ae8074cc1cf71 Mon Sep 17 00:00:00 2001 From: Diwak4r Date: Thu, 3 Sep 2026 23:42:06 +0545 Subject: [PATCH] style: ruff-format the delegation-ceiling block The branch was cut before lint's ruff-format gate could run on this file (CI pre-filter failed on a missing local action, now merged in). Format the added block to match ruff==0.15.3. --- .../key_management_endpoints.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/litellm/proxy/management_endpoints/key_management_endpoints.py b/litellm/proxy/management_endpoints/key_management_endpoints.py index ec02e490e81..9762c40e6f1 100644 --- a/litellm/proxy/management_endpoints/key_management_endpoints.py +++ b/litellm/proxy/management_endpoints/key_management_endpoints.py @@ -2884,13 +2884,8 @@ async def _validate_update_key_data( # one in the key's metadata still applies (it is added on top of # max_budget at request time by _update_key_budget_with_temp_budget_increase). _effective_temp_increase: float | None = data.temp_budget_increase - if ( - _effective_temp_increase is None - and existing_key_row.metadata is not None - ): - _persisted_increase: Final = existing_key_row.metadata.get( - "temp_budget_increase" - ) + if _effective_temp_increase is None and existing_key_row.metadata is not None: + _persisted_increase: Final = existing_key_row.metadata.get("temp_budget_increase") if _persisted_increase is not None: try: _persisted_expiry: Final = datetime.fromisoformat( @@ -2906,10 +2901,7 @@ async def _validate_update_key_data( raise HTTPException( status_code=400, detail={ - "error": ( - f"temp_budget_increase must be a finite number. " - f"Received: {_effective_temp_increase}" - ) + "error": (f"temp_budget_increase must be a finite number. Received: {_effective_temp_increase}") }, ) # temp_budget_increase is applied on top of the key's max_budget at