kevinjqliu commented on code in PR #2564:
URL: https://github.com/apache/iceberg-python/pull/2564#discussion_r2404621480


##########
pyiceberg/expressions/__init__.py:
##########
@@ -212,18 +214,18 @@ class Reference(UnboundTerm[Any]):
         An unbound reference is sometimes referred to as a "named" reference.
     """
 
-    name: str
+    root: str = Field()
 
     def __init__(self, name: str) -> None:
-        self.name = name
+        super().__init__(name)
 
     def __repr__(self) -> str:
         """Return the string representation of the Reference class."""
-        return f"Reference(name={repr(self.name)})"
+        return f"Reference(name={repr(self.root)})"
 
-    def __eq__(self, other: Any) -> bool:
-        """Return the equality of two instances of the Reference class."""
-        return self.name == other.name if isinstance(other, Reference) else 
False

Review Comment:
   pydantic should fall back to the RootModel's __eq__ which checks the root 
field



##########
pyiceberg/expressions/__init__.py:
##########
@@ -212,18 +214,18 @@ class Reference(UnboundTerm[Any]):
         An unbound reference is sometimes referred to as a "named" reference.
     """
 
-    name: str
+    root: str = Field()
 
     def __init__(self, name: str) -> None:
-        self.name = name
+        super().__init__(name)
 
     def __repr__(self) -> str:
         """Return the string representation of the Reference class."""
-        return f"Reference(name={repr(self.name)})"
+        return f"Reference(name={repr(self.root)})"
 
-    def __eq__(self, other: Any) -> bool:
-        """Return the equality of two instances of the Reference class."""
-        return self.name == other.name if isinstance(other, Reference) else 
False

Review Comment:
   pydantic should fall back to the RootModel's `__eq__` which checks the root 
field



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to