Trim verbose comments and docstrings
This commit is contained in:
parent
2b9ad4d4eb
commit
04687ba48e
@ -3289,9 +3289,6 @@ async def _check_team_member_budget(
|
||||
|
||||
# Per-member override wins; otherwise fall back to the team-level
|
||||
# default configured via team.metadata["team_member_budget_id"].
|
||||
# A per-member row whose max_budget is NULL is *not* an override -
|
||||
# it can result from cloning a team default that itself had no cap
|
||||
# at member-add time. Treat it as "no override" and fall through.
|
||||
team_member_budget: Optional[float] = None
|
||||
if (
|
||||
team_membership is not None
|
||||
|
||||
@ -2340,14 +2340,7 @@ async def test_team_member_budget_check_per_member_override_wins_over_team_defau
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_team_member_budget_check_null_clone_falls_back_to_team_default():
|
||||
"""A per-member budget row with max_budget=NULL is not an explicit
|
||||
no-cap override - it can be the result of cloning a team default that
|
||||
had no value at member-add time. Enforcement must fall through to the
|
||||
team default and apply that cap.
|
||||
|
||||
Pre-fix: NULL on the clone short-circuited the comparison block
|
||||
(team_member_budget = None -> if not None: skipped) so the user
|
||||
spent unbounded against an apparent $65/$X cap."""
|
||||
"""Per-member NULL max_budget falls through to the team default cap."""
|
||||
from litellm.caching.dual_cache import DualCache
|
||||
from litellm.proxy._types import LiteLLM_BudgetTable, LiteLLM_TeamMembership
|
||||
from litellm.proxy.utils import ProxyLogging
|
||||
@ -2415,10 +2408,7 @@ async def test_team_member_budget_check_null_clone_falls_back_to_team_default():
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_team_member_budget_check_null_clone_with_null_default_skips_enforcement():
|
||||
"""Sanity check: when both the per-member clone AND the team default
|
||||
have max_budget=NULL, enforcement still skips (the team genuinely has
|
||||
no cap configured). Confirms the NULL-fall-through is defensive, not
|
||||
overzealous."""
|
||||
"""When per-member and team default are both NULL, enforcement still skips."""
|
||||
from litellm.caching.dual_cache import DualCache
|
||||
from litellm.proxy._types import LiteLLM_BudgetTable, LiteLLM_TeamMembership
|
||||
from litellm.proxy.utils import ProxyLogging
|
||||
|
||||
Loading…
Reference in New Issue
Block a user