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:
[email protected]



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

Reply via email to