mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-14 09:03:16 +00:00
fix(key/info): remove redundant None check to satisfy basedpyright delta gate
After if not key: raise, key is narrowed to str. The subsequent if key is not None: guard is always true and triggers basedpyright reportUnnecessaryComparison, which fails the delta gate. Collapse to a single hash_token_if_needed(token=key) call. Signed-off-by: apex-mochen <2756823972@qq.com>
This commit is contained in:
parent
b3c00afc26
commit
280f14f61f
1 changed files with 1 additions and 3 deletions
|
|
@ -5111,9 +5111,7 @@ async def info_key_fn(
|
|||
param="key",
|
||||
code=status.HTTP_400_BAD_REQUEST,
|
||||
)
|
||||
hashed_key: str | None = key
|
||||
if key is not None:
|
||||
hashed_key = hash_token_if_needed(token=key) # rebind-ok: pre-existing rebinding on a rename-only line
|
||||
hashed_key: str | None = hash_token_if_needed(token=key)
|
||||
live_key_info: Final = await _prisma_table(VerificationTokenRepository(prisma_client)).find_unique(
|
||||
where={"token": hashed_key},
|
||||
include={"litellm_budget_table": True},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue