fix(lint): suppress PLR0915 too many statements in route_request#21390
Merged
fix(lint): suppress PLR0915 too many statements in route_request#21390
Conversation
Add noqa comment for "too many statements" lint error in route_request(). The function has 60 statements (limit is 50) but refactoring it properly would be a significant undertaking requiring careful testing. The function handles routing for 50+ different request types and contains complex logic that should be addressed in a dedicated refactoring effort, not as part of a lint fix. Error: proxy/route_llm_request.py:145:11: PLR0915 Too many statements (60 > 50) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Greptile SummaryThis PR adds a
Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| litellm/proxy/route_llm_request.py | Adds # noqa: PLR0915 comment to suppress "too many statements" lint warning on the route_request() function. No functional changes. Follows the established pattern used across 100+ other functions in this codebase. |
Flowchart
flowchart TD
A[PR Change: route_llm_request.py] --> B[route_request function definition]
B --> C{PLR0915 lint check}
C -->|Before PR| D[FAIL: 60 statements > 50 max]
C -->|After PR| E["PASS: # noqa: PLR0915 suppresses warning"]
D --> F[CI blocked]
E --> G[CI passes]
Last reviewed commit: 289341d
jquinter
added a commit
that referenced
this pull request
Feb 17, 2026
Add two detailed guides for addressing CI test flakiness: 1. test-flakiness-guide.md - Developer guide with: - How to use @pytest.mark.no_parallel for async mocks - Patterns for robust async mock setup - Retry logic strategies - Module reload issues and fixes - Quick reference and checklist 2. ci-test-improvements.md - Implementation plan with: - Priority phased rollout (Quick wins → CI → Enforcement) - pytest-rerunfailures plugin setup - GitHub Actions improvements for retries - Makefile targets for testing - Pre-commit hooks for test quality - Test utilities module with decorators - Success metrics and monitoring These guides provide actionable solutions for the CI test failures observed in PRs #21107, #21388, and #21390. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Lint error blocking CI:
Solution
Add
# noqa: PLR0915comment to suppress the "too many statements" warning.Why Not Refactor?
The
route_request()function is 305 lines and handles routing for 50+ different request types:acompletion,aembedding,aimage_generation,aspeech,atranscriptionarerank,aresponses,avector_store_*,aocr,asearchavideo_*,acontainer_*,askill_*,aingestaevals,aruns, and many more...Refactoring this properly would require:
This is better suited for a dedicated refactoring effort, not a lint fix PR.
Impact
Related