jun-he commented on a change in pull request #3450:
URL: https://github.com/apache/iceberg/pull/3450#discussion_r820986970
##########
File path: python/src/iceberg/types.py
##########
@@ -41,6 +45,12 @@ def __new__(cls, *args, **kwargs):
return cls._instance
+class Truncatable(ABC):
Review comment:
Thanks for pointing it out and that's a great point. Updated the code to
use TypeVar and Generic for that.
##########
File path: python/src/iceberg/types.py
##########
@@ -494,6 +516,10 @@ def __init__(self):
if not self._initialized:
super().__init__("string", "StringType()")
+ def truncate(self, value: str, width: int) -> str:
+ """Truncate a given string into a given width."""
Review comment:
Thanks, corrected it.
##########
File path: python/tests/test_types.py
##########
@@ -56,6 +56,7 @@
@pytest.mark.parametrize("input_index, input_type", non_parameterized_types)
def test_repr_primitive_types(input_index, input_type):
+ assert input_type.is_primitive
Review comment:
Sure, removed.
--
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]