diff --git a/pyiceberg/expressions/__init__.py b/pyiceberg/expressions/__init__.py index f0dc4094d9..4871da3e0a 100644 --- a/pyiceberg/expressions/__init__.py +++ b/pyiceberg/expressions/__init__.py @@ -370,10 +370,10 @@ def __getnewargs__(self) -> tuple[BooleanExpression]: return (self.child,) -class AlwaysTrue(BooleanExpression, Singleton, IcebergRootModel[str]): +class AlwaysTrue(BooleanExpression, Singleton, IcebergRootModel[bool]): """TRUE expression.""" - root: str = "true" + root: bool = True def __invert__(self) -> AlwaysFalse: """Transform the Expression into its negated version.""" @@ -388,10 +388,10 @@ def __repr__(self) -> str: return "AlwaysTrue()" -class AlwaysFalse(BooleanExpression, Singleton, IcebergRootModel[str]): +class AlwaysFalse(BooleanExpression, Singleton, IcebergRootModel[bool]): """FALSE expression.""" - root: str = "false" + root: bool = False def __invert__(self) -> AlwaysTrue: """Transform the Expression into its negated version.""" diff --git a/tests/expressions/test_expressions.py b/tests/expressions/test_expressions.py index 1fbe8d7a6c..47c26c8eb6 100644 --- a/tests/expressions/test_expressions.py +++ b/tests/expressions/test_expressions.py @@ -770,7 +770,7 @@ def test_not_json_serialization_and_deserialization() -> None: def test_always_true() -> None: always_true = AlwaysTrue() - assert always_true.model_dump_json() == '"true"' + assert always_true.model_dump_json() == "true" assert str(always_true) == "AlwaysTrue()" assert repr(always_true) == "AlwaysTrue()" assert always_true == eval(repr(always_true)) @@ -779,7 +779,7 @@ def test_always_true() -> None: def test_always_false() -> None: always_false = AlwaysFalse() - assert always_false.model_dump_json() == '"false"' + assert always_false.model_dump_json() == "false" assert str(always_false) == "AlwaysFalse()" assert repr(always_false) == "AlwaysFalse()" assert always_false == eval(repr(always_false))