From 73dfe12839de901d83cf943025d47a81c98d64bb Mon Sep 17 00:00:00 2001 From: lior-k Date: Sun, 5 Jul 2026 16:43:53 +0300 Subject: [PATCH] chore(guardrails): use PEP 604 union for event_hook param The strict gate's UP007 ceiling dropped on the new base; convert the event_hook Union[...] annotation to X | Y and drop the now-unused Union import. --- .../guardrail_hooks/alice_wonderfence/alice_wonderfence.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/proxy/guardrails/guardrail_hooks/alice_wonderfence/alice_wonderfence.py b/litellm/proxy/guardrails/guardrail_hooks/alice_wonderfence/alice_wonderfence.py index acdb5a0253d..585687cacf8 100644 --- a/litellm/proxy/guardrails/guardrail_hooks/alice_wonderfence/alice_wonderfence.py +++ b/litellm/proxy/guardrails/guardrail_hooks/alice_wonderfence/alice_wonderfence.py @@ -3,7 +3,7 @@ import logging import os from collections import OrderedDict -from typing import TYPE_CHECKING, Any, Literal, Optional, Union +from typing import TYPE_CHECKING, Any, Literal, Optional from fastapi import HTTPException @@ -77,7 +77,7 @@ class WonderFenceGuardrail(CustomGuardrail): max_cached_clients: int | None = None, connection_pool_limit: int | None = None, allow_request_metadata_override: bool = False, - event_hook: (Union[GuardrailEventHooks, list[GuardrailEventHooks], Mode] | None) = None, + event_hook: (GuardrailEventHooks | list[GuardrailEventHooks] | Mode | None) = None, default_on: bool = True, **kwargs: Any, ) -> None: