mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-11 03:38:38 +00:00
refactor(guardrails): end the record scope match with a final assert_never
CodeQL does not treat a case _ arm as making the match exhaustive, so it flagged a possible implicit None return. The match now covers the three scopes and returns assert_never after it, as other matches in the repo do
This commit is contained in:
parent
290ec6f5c9
commit
a765188dc7
1 changed files with 1 additions and 2 deletions
|
|
@ -85,8 +85,7 @@ class RecordScope:
|
|||
return False
|
||||
case "per_session":
|
||||
return session_id is None or self._claim_session(json.dumps((*caller, session_id, input_type)))
|
||||
case _:
|
||||
return assert_never(self._scope)
|
||||
return assert_never(self._scope)
|
||||
|
||||
def _claim_session(self, key: str) -> bool:
|
||||
if self._recorded_sessions.get_cache(key) is True:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue