test(bedrock): accept the router kwarg in the knowledge base search fake - #39420
Conversation
|
bugbot run |
|
PR #39420 labeled |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit b6b5b31. Configure here.
Greptile SummaryThis test-only change updates the Bedrock knowledge-base search fake to match the real handler’s optional router parameter.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| tests/logging_callback_tests/test_bedrock_knowledgebase_hook.py | The fake handler now accepts and types the optional router argument, resolving the prior thread without changing test assertions or production behavior. |
Reviews (2): Last reviewed commit: "test(bedrock): type the router parameter..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 8e26d13. Configure here.
3c6b070
into
litellm_internal_staging
TLDR
Problem this solves:
logging_testingis red on staging since PR fix(vector_stores): s3 vectors search router bypass + rag query config drop + ui error swallow #34788routerkwargHow it solves it:
router=None, matching the real handlerUser Flow
Before: any PR that merges staging inherits a red CircleCI
logging_testingjob, becausetest_bedrock_kb_request_body_has_transformed_filtersdies withTypeError: got an unexpected keyword argument 'router'before it asserts anythingAfter: the same job runs that test through its assertions and goes green, so PRs merging staging stop inheriting the red job
Relevant issues
None
Linear ticket
Resolves LIT-6766
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
uv run pytest tests/test_litellm/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more@greptileaito re-request a review after pushing changes)Delays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
This change has no end-user surface, so the proof is the failing test itself: the same pytest command at the merge base and at the tip, run from a bootstrapped worktree, plus the CircleCI
logging_testingjob on this PRBefore (719b671)
uv run --no-sync pytest tests/logging_callback_tests/test_bedrock_knowledgebase_hook.py::test_bedrock_kb_request_body_has_transformed_filters -q -p no:cacheproviderAfter (8e26d13)
uv run --no-sync pytest tests/logging_callback_tests/test_bedrock_knowledgebase_hook.py::test_bedrock_kb_request_body_has_transformed_filters -q -p no:cacheprovideruv run --no-sync pytest tests/logging_callback_tests/test_bedrock_knowledgebase_hook.py -q -p no:cacheprovider(the whole file)botocore[crt], and the mock-OpenAI cases fail the same way at the merge base, where the whole file reads8 failed, 4 passed, 1 warning in 25.51s; the only delta between the two runs is this PR's test):logging_testingon this PR: green at b6b5b31ce4 (the same fix before therouterparameter got its annotation); at this tip: green at 8e26d13fa0. The three red non-required jobs in that workflow (local_testing_part1,local_testing_part2,litellm_router_testing) each fail on a single live-OpenAI timeout test (test_openai_embedding_timeouts,test_timeout_streaming,test_router_timeout) with an httpx connection error, the known timeout flakes, unrelated to this fileType
✅ Test
Caveats (if any)
Low
router; the test asserts the Bedrock request body, not routingrouterparameter carries a type annotation; the fake's other twelve parameters stay untyped as they were, since the file sits outside the basedpyright gatepatch.objectin the same test, so there is no proxy path to A/B; CHECKED at 8e26d13: CircleCIlogging_testinggreen, no untested dependent path, no breaking changecaptured_request_body: dict = {}predates this PR and stays untouchedFinal Attestation