From daf51cc8782a66283b823e9de1dbf83d79daea02 Mon Sep 17 00:00:00 2001 From: JingHao-Leon <102573344+JingHao-Leon@users.noreply.github.com> Date: Sun, 11 Oct 2026 21:28:46 +0800 Subject: [PATCH] TID251 bans typing.cast, so say why this one is allowed ruff_strict_gate counts TID251 against the merge-base and the new cast import put the file one over. The config's own note for that rule allows a suppression with a reason, and the reasoning is narrow: response_format reaches us as an arbitrary JSON object from the provider, and the branch immediately reads one key off it and compares against three literal strings. The stricter alternative in the rule's message is a pydantic boundary model. That would be the right call if these values were persisted or forwarded to a caller, and it is not here. strict-rule counts now match the merge-base exactly. 164 tests pass and the type-discipline and test-quality gates stay within their ceilings. --- litellm/llms/gigachat/chat/transformation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/llms/gigachat/chat/transformation.py b/litellm/llms/gigachat/chat/transformation.py index 6d7908a6e85..bc6a6673860 100644 --- a/litellm/llms/gigachat/chat/transformation.py +++ b/litellm/llms/gigachat/chat/transformation.py @@ -11,7 +11,7 @@ import time import uuid from collections.abc import AsyncIterator, Iterator, Mapping, Sequence from types import MappingProxyType -from typing import TYPE_CHECKING, Any, Final, cast +from typing import TYPE_CHECKING, Any, Final, cast # noqa: TID251 # response_format is a plain JSON object import httpx