mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-08 03:08:45 +00:00
fix(guardrails): satisfy ruff format and the test-tree lint
Two leftovers from narrowing this PR, both caught by CI's lint job: - `_bin_pack_bedrock_content` kept its `lengths` tuple wrapped over three lines after the image dimension came out, but the expression fits on one again, so `ruff format --check` wanted it back. It now matches the base byte for byte and the function drops out of the diff entirely. - the test module's top-level `from datetime import datetime, timezone` had no remaining user: the only `datetime` reference resolves through the local `import datetime` inside `test_load_credentials_assumes_role_with_external_id`, so the top-level form was shadowed and tripped F811.
This commit is contained in:
parent
f04847f243
commit
669761f7c8
2 changed files with 1 additions and 4 deletions
|
|
@ -1649,9 +1649,7 @@ class BedrockGuardrail(CustomGuardrail, BaseAWSLLM):
|
|||
if not content:
|
||||
return (tuple(content),)
|
||||
|
||||
lengths: Final = tuple(
|
||||
len((item.get("text") or BedrockTextContent()).get("text") or "") for item in content
|
||||
)
|
||||
lengths: Final = tuple(len((item.get("text") or BedrockTextContent()).get("text") or "") for item in content)
|
||||
|
||||
def assign(carried: tuple[int, int], length: int) -> tuple[int, int]:
|
||||
batch_index, used = carried
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import asyncio
|
|||
import base64
|
||||
import json
|
||||
import sys
|
||||
from datetime import datetime, timezone
|
||||
from unittest.mock import AsyncMock, MagicMock, patch
|
||||
|
||||
import httpx
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue