Skip to content

Commit e670617

Browse files
update true and false class
1 parent adc2851 commit e670617

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

pyiceberg/expressions/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@
3939
literal,
4040
)
4141
from pyiceberg.schema import Accessor, Schema
42-
from pyiceberg.typedef import L, StructProtocol
42+
from pyiceberg.typedef import L, StructProtocol, IcebergBaseModel, IcebergRootModel
4343
from pyiceberg.types import DoubleType, FloatType, NestedField
4444
from pyiceberg.utils.singleton import Singleton
45+
from pydantic import model_serializer
4546

4647

4748
def _to_unbound_term(term: Union[str, UnboundTerm[Any]]) -> UnboundTerm[Any]:
@@ -362,8 +363,9 @@ def __getnewargs__(self) -> Tuple[BooleanExpression]:
362363
return (self.child,)
363364

364365

365-
class AlwaysTrue(BooleanExpression, Singleton):
366+
class AlwaysTrue(BooleanExpression, Singleton, IcebergRootModel):
366367
"""TRUE expression."""
368+
root: str = "true"
367369

368370
def __invert__(self) -> AlwaysFalse:
369371
"""Transform the Expression into its negated version."""
@@ -378,8 +380,9 @@ def __repr__(self) -> str:
378380
return "AlwaysTrue()"
379381

380382

381-
class AlwaysFalse(BooleanExpression, Singleton):
383+
class AlwaysFalse(BooleanExpression, Singleton, IcebergRootModel):
382384
"""FALSE expression."""
385+
root: str = "false"
383386

384387
def __invert__(self) -> AlwaysTrue:
385388
"""Transform the Expression into its negated version."""

0 commit comments

Comments
 (0)