mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-15 09:12:18 +00:00
fix(guardrails): put the cast-ok marker on the cast's own line
The type-discipline gate then failed where the basedpyright one had passed: LIT006 wants `# cast-ok: <reason>` on the cast call's first line, and my reason sat four lines above it, so LIT013 also fired -- a marker that suppresses nothing. Matches the existing cast in this file, which puts the marker as a trailing comment on `cast(`. Verified with the repo's own scripts/check_type_discipline.py against the gate's base SHA: LIT006 and LIT013 are back to the base count and LIT011 is one lower, so no rule grows. 39 tests pass; ruff clean.
This commit is contained in:
parent
535460e321
commit
ba2bc7c9fe
1 changed files with 3 additions and 5 deletions
|
|
@ -245,11 +245,9 @@ def _ensure_litellm_metadata(data: dict, user_api_key_dict: UserAPIKeyAuth) -> N
|
|||
)
|
||||
|
||||
BaseTranslation.merge_user_api_key_metadata_into_request(
|
||||
# cast-ok: `data` is the request payload, annotated here as a bare
|
||||
# dict, so passing it on is an unknown argument type. _RequestData is
|
||||
# this module's own alias for it and keeps the argument fully known
|
||||
# without widening three signatures or naming Any again.
|
||||
cast(_RequestData, data),
|
||||
cast( # cast-ok: _RequestData is this module's own alias for the bare-dict request payload
|
||||
_RequestData, data
|
||||
),
|
||||
user_api_key_dict,
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue