samredai commented on code in PR #4619:
URL: https://github.com/apache/iceberg/pull/4619#discussion_r857183249
##########
python/src/iceberg/expressions/base.py:
##########
@@ -147,3 +148,61 @@ def get(self, container: StructProtocol) -> Any:
Any: The value at position `self.position` in the container
"""
return container.get(self.position)
+
+
+class BoundReference:
+ """A reference bound to a field with an accessor for acquiring the field's
value
+
+ Args:
+ field (NestedField): A referenced field in an Iceberg schema
+ accessor (Accessor): An Accessor object to access the value at the
field's position
+ """
+
+ def __init__(self, field: NestedField, accessor: Accessor):
+ self._field = field
+ self._accessor = accessor
+
+ def __str__(self):
+ return f"ref(id={self.field_id})"
+
+ def __repr__(self):
+ return f"BoundReference(field={repr(self.field)},
accessor={repr(self.accessor)})"
Review Comment:
Thanks for catching this, I added a repr to Accessor.
--
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]