You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2021/06/01 11:35:32 UTC

[GitHub] [iceberg] TGooch44 commented on a change in pull request #2655: [Python] add to_byte_buffer to literal classes

TGooch44 commented on a change in pull request #2655:
URL: https://github.com/apache/iceberg/pull/2655#discussion_r643020801



##########
File path: python/iceberg/api/types/conversions.py
##########
@@ -81,11 +82,11 @@ def from_partition_string(type_var, as_string):
         return part_func(as_string)
 
     @staticmethod
-    def to_byte_buffer(type_var, value):
+    def to_byte_buffer(type_id, value):
         try:
-            return Conversions.to_byte_buff_mapping.get(type_var.type_id)(type_var, value)
+            return Conversions.to_byte_buff_mapping.get(type_id)(type_id, value)
         except KeyError:
-            raise RuntimeError("Cannot Serialize Type: %s" % type_var)
+            raise RuntimeError("Cannot Serialize Type: %s" % type_id)

Review comment:
       Since you're touching this code anyway, it may be more appropriate to raise either TypeError or NotImplementedError here.  There are a number of exceptions in this codebase that raise Runtime but should raise something more specific.




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org