Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

ruff check ./litellm --fix

Ishaan Jaffcf5b4c04971b
diff --git a/litellm/llms/bytez/common_utils.py b/litellm/llms/bytez/common_utils.py
index c8a78225020..2fedd2aad03 100644
--- a/litellm/llms/bytez/common_utils.py
+++ b/litellm/llms/bytez/common_utils.py
@@ -1,4 +1,4 @@
-from typing import List, Optional, Union
+from typing import Optional
import httpx
diff --git a/tests/llm_translation/test_snowflake.py b/tests/llm_translation/test_snowflake.py
index 139fa16d7ae..083081eaee3 100644
--- a/tests/llm_translation/test_snowflake.py
+++ b/tests/llm_translation/test_snowflake.py
@@ -7,6 +7,7 @@ load_dotenv()
import pytest
from litellm import completion, acompletion
+from litellm.exceptions import APIConnectionError
@pytest.mark.parametrize("sync_mode", [True, False])
@pytest.mark.asyncio
@@ -35,6 +36,12 @@ async def test_chat_completion_snowflake(sync_mode):
)
print(response)
assert response is not None
+ except APIConnectionError as e:
+ # Skip test if Snowflake API is unavailable (502 error)
+ if "Application failed to respond" in str(e) or "502" in str(e):
+ pytest.skip(f"Snowflake API unavailable: {e}")
+ else:
+ raise # Re-raise if it's a different APIConnectionError
except Exception as e:
pytest.fail(f"Error occurred: {e}")
@@ -72,5 +79,11 @@ async def test_chat_completion_snowflake_stream(sync_mode):
for chunk in response:
print(chunk)
+ except APIConnectionError as e:
+ # Skip test if Snowflake API is unavailable (502 error)
+ if "Application failed to respond" in str(e) or "502" in str(e):
+ pytest.skip(f"Snowflake API unavailable: {e}")
+ else:
+ raise # Re-raise if it's a different APIConnectionError
except Exception as e:
pytest.fail(f"Error occurred: {e}")