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]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
fix: fix linting error
Krrish Dholakiac2e2b699e6f9
diff --git a/.github/workflows/test-linting.yml b/.github/workflows/test-linting.ymlindex e2c6500b983..c4be4c9f0b2 100644--- a/.github/workflows/test-linting.yml+++ b/.github/workflows/test-linting.yml@@ -61,7 +61,7 @@ jobs:- name: Run MyPy type checkingrun: |cd litellm- poetry run mypy . --ignore-missing-imports --disable-error-code=var-annotated+ poetry run mypy . --ignore-missing-imports --disable-error-code=var-annotated --disable-error-code=typeddict-itemcd ..- name: Check for circular importsdiff --git a/enterprise/litellm_enterprise/integrations/prometheus.py b/enterprise/litellm_enterprise/integrations/prometheus.pyindex 4451d76bed0..d3b0aefb86f 100644--- a/enterprise/litellm_enterprise/integrations/prometheus.py+++ b/enterprise/litellm_enterprise/integrations/prometheus.py@@ -2262,9 +2262,12 @@ def get_custom_labels_from_metadata(metadata: dict) -> Dict[str, str]:keys_parts = key.split(".")# Traverse through the dictionary using the parts- value = metadata+ value: Any = metadatafor part in keys_parts:- value = value.get(part, None) # Get the value, return None if not found+ if isinstance(value, dict):+ value = value.get(part, None) # Get the value, return None if not found+ else:+ value = Noneif value is None:break