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 2022/01/20 16:59:11 UTC

[GitHub] [iceberg] samredai commented on a change in pull request #3940: Python: Fix type for partition_type struct fields (#3939)

samredai commented on a change in pull request #3940:
URL: https://github.com/apache/iceberg/pull/3940#discussion_r788965764



##########
File path: python_legacy/iceberg/api/partition_spec.py
##########
@@ -76,7 +76,7 @@ def partition_type(self):
             result_type = field.transform.get_result_type(source_type)
             struct_fields.append(NestedField.optional(field.field_id,
                                                       field.name,
-                                                      result_type))
+                                                      result_type.get()))

Review comment:
       Thanks for catching this @cccs-eric ! There are a few types that do not have a `get` method, such as [DecimalType](https://github.com/apache/iceberg/blob/master/python_legacy/iceberg/api/types/types.py#L372). Wouldn't that cause an issue here?
   
   I'm wondering if maybe we can override this [as_primitive_type](https://github.com/apache/iceberg/blob/master/python_legacy/iceberg/api/types/type.py#L57) method from the super for some classes so that it always returns the type. That way [this](https://github.com/apache/iceberg/blob/master/python_legacy/iceberg/api/types/type_util.py#L148) line in the visit function can be moved into a try-except in the final else block on the next line where the except would raise the RuntimeError.
   
   @TGooch44 what do you think?




-- 
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: issues-unsubscribe@iceberg.apache.org

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