Skip to content

Commit 474aa0d

Browse files
committed
One more!
1 parent 9c50eee commit 474aa0d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pyiceberg/expressions/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import builtins
2121
from abc import ABC, abstractmethod
2222
from functools import cached_property
23-
from typing import Any, Callable, Iterable, Sequence, cast
23+
from typing import TYPE_CHECKING, Any, Callable, Iterable, Sequence, cast
2424
from typing import Literal as TypingLiteral
2525

2626
from pydantic import ConfigDict, Field
@@ -36,7 +36,10 @@
3636
except ImportError:
3737
ConfigDict = dict
3838

39-
LiteralValue = Literal[Any]
39+
if TYPE_CHECKING:
40+
LiteralValue = Literal[Any]
41+
else:
42+
LiteralValue = Literal
4043

4144

4245
def _to_unbound_term(term: str | UnboundTerm) -> UnboundTerm:
@@ -772,7 +775,7 @@ class LiteralPredicate(IcebergBaseModel, UnboundPredicate, ABC):
772775
value: LiteralValue = Field()
773776
model_config = ConfigDict(populate_by_name=True, frozen=True, arbitrary_types_allowed=True)
774777

775-
def __init__(self, term: str | UnboundTerm, literal: Any | LiteralValue):
778+
def __init__(self, term: str | UnboundTerm, literal: Any):
776779
super().__init__(term=_to_unbound_term(term), value=_to_literal(literal)) # type: ignore[call-arg]
777780

778781
@property

0 commit comments

Comments
 (0)