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/06/07 14:14:46 UTC

[GitHub] [iceberg] Fokko opened a new issue, #4985: Conform Python API to tablespec

Fokko opened a new issue, #4985:
URL: https://github.com/apache/iceberg/issues/4985

   Hi everyone 👋🏻 
   
   I'm working on the (de)serialization of the TableMetadata and noticed that there are some discrepancies between the public Python API and the naming in the Python spec. Mostly when it comes to types. I would suggest updating these fields to make (de)serialization easier, but also to keep consistency in the different libraries.
   
   - NestedField
     - `field_id`: `id` in the spec, but `id` is a keyword in Python, which is not recommended to use.
     - `name`
     - `field_type`: `type` in the spec, but `type` is a keyword in Python, which is not recommended to use.
     - `is_optional` → `required`
     - `doc`
   - **StructType**
     - `fields`
   - **ListType**
     - `type`
     - `element_id`
     - `element_type` → `element`
     - `element_is_optional` → `element_required`
     - `element` → `element_field`: `element` is a type in the spec, not a field
   - **MapType**
     -  `key_id`
     -  `key_type` → `key`
     -  `value_id`
     -  `value_type` → `value`
     -  `value_is_optional` → `value_required`
     -  `key` → `key_field`: `key` is a type in the spec, not a field
     -  `value` → `value_field`:  `value` is a type in the spec, not a field
   
   I would love to get feedback from the community on this. I would love to get closer to the naming in the spec since there is no official release of the Python package.


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


[GitHub] [iceberg] Fokko commented on issue #4985: Conform Python API to tablespec

Posted by GitBox <gi...@apache.org>.
Fokko commented on issue #4985:
URL: https://github.com/apache/iceberg/issues/4985#issuecomment-1149145976

   I went ahead and created a PR https://github.com/apache/iceberg/pull/4992
   
   @rdblue suggested to keep `_type` postfix for `element` for the List, `key` and `value` for the Map. This is in line with the `field_type` of the NestedField. Also, Java also uses `keyType`: https://github.com/apache/iceberg/blob/master/api/src/main/java/org/apache/iceberg/types/Types.java#L761-L777
   
   Next to that, Java uses `keyField`, so this also nicely aligns then by renaming `key` into `key_field` in Python.


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


[GitHub] [iceberg] Fokko closed issue #4985: Conform Python API to tablespec

Posted by GitBox <gi...@apache.org>.
Fokko closed issue #4985: Conform Python API to tablespec
URL: https://github.com/apache/iceberg/issues/4985


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


[GitHub] [iceberg] Fokko commented on issue #4985: Conform Python API to tablespec

Posted by GitBox <gi...@apache.org>.
Fokko commented on issue #4985:
URL: https://github.com/apache/iceberg/issues/4985#issuecomment-1151465801

   PR has been merged, thanks @danielcweeks 


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