diff --git a/pyproject.toml b/pyproject.toml index 5f60d4351..8e65536a0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -223,7 +223,7 @@ disable = ["R0801"] extend-exclude = ["tests/profiles/syntax_error.py"] [tool.ruff.lint] -extend-select = ["TID251", "UP006", "UP007", "UP017", "UP035", "RUF100", "B010"] +extend-select = ["TID251", "UP006", "UP007", "UP017", "UP035", "RUF100", "B009", "B010"] [tool.ruff.lint.flake8-tidy-imports.banned-api] unittest = { msg = "use pytest instead of unittest" } diff --git a/src/app/endpoints/streaming_query.py b/src/app/endpoints/streaming_query.py index d77f26807..d04e9d5be 100644 --- a/src/app/endpoints/streaming_query.py +++ b/src/app/endpoints/streaming_query.py @@ -698,7 +698,7 @@ async def response_generator( # pylint: disable=too-many-branches,too-many-stat # Completed response - capture final text and response object elif event_type == "response.completed": latest_response_object = cast( - OpenAIResponseObject, getattr(chunk, "response") + OpenAIResponseObject, getattr(chunk, "response") # noqa: B009 ) turn_summary.llm_response = turn_summary.llm_response or "".join(text_parts) yield stream_event( @@ -714,7 +714,7 @@ async def response_generator( # pylint: disable=too-many-branches,too-many-stat # Incomplete or failed response - emit error elif event_type in ("response.incomplete", "response.failed"): latest_response_object = cast( - OpenAIResponseObject, getattr(chunk, "response") + OpenAIResponseObject, getattr(chunk, "response") # noqa: B009 ) error_message = ( latest_response_object.error.message