Skip to content

fix(router): use PEP 585 frozenset[str] to satisfy UP006 strict budget - #33493

Closed
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/ci-autofix-automation-23a1
Closed

cursor[bot] wants to merge 1 commit into
mainfrom
cursor/ci-autofix-automation-23a1

Conversation

@cursor

@cursor cursor Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Relevant issues

Linear ticket

Pre-Submission checklist

  • I have added meaningful tests
  • My PR passes all CI/CD checks (e.g., lint, format, unit tests)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have received a Greptile Confidence Score of at least 4/5

Screenshots / Proof of Fix

Before this fix, LiteLLM Linting > Check strict-rule budget (delta vs base) on the promote-staging-to-main PR #33491 (head 39c01fe) failed with:

FAIL: strict-rule totals exceed their limit (base 0fbdea4bf5be35561a3cc0c12a431f8f221618b1):
  UP006: total 12794 over limit 12792 (this change added 1)
    litellm/router.py:499

Run log: https://github.com/BerriAI/litellm/actions/runs/29464302114

After this fix, running the same gate locally against the same base:

$ python3 scripts/ruff_strict_gate.py --base 0fbdea4bf5be35561a3cc0c12a431f8f221618b1
OK: every strict rule is within its codebase ceiling (base 0fbdea4bf5be35561a3cc0c12a431f8f221618b1)

Type

🐛 Bug Fix

Changes

PR #32926 introduced self.team_public_model_names: FrozenSet[str] = frozenset() at litellm/router.py:499 using the deprecated typing.FrozenSet, which trips ruff's UP006 non-pep585-annotation rule and pushed the repo one violation over the strict-rule ceiling (12794 vs. limit 12792). Switching the annotation to the PEP 585 built-in generic frozenset[str] and dropping the now-unused FrozenSet import brings the count back down to the base level and clears the gate.

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR
Open in Web View Automation 

Co-authored-by: Krrish Dholakia <krrish-berri-2@users.noreply.github.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@codspeed

codspeed Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing cursor/ci-autofix-automation-23a1 (b2a7a83) with litellm_internal_staging (39c01fe)

Open in CodSpeed

@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@yuneng-berri
yuneng-berri deleted the branch main September 13, 2026 04:31
@yuneng-berri yuneng-berri reopened this Sep 13, 2026
@devin-ai-integration
devin-ai-integration Bot changed the base branch from litellm_internal_staging to main September 23, 2026 15:40
@mateo-berri

Copy link
Copy Markdown
Contributor

This lint fix already landed on main with #35495, and router.py passes ruff now. Please reopen if something is missing

@mateo-berri mateo-berri closed this Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants