Fokko commented on code in PR #473:
URL: https://github.com/apache/iceberg-python/pull/473#discussion_r1512278316


##########
pyiceberg/table/metadata.py:
##########
@@ -263,6 +264,12 @@ def sort_order_by_id(self, sort_order_id: int) -> 
Optional[SortOrder]:
         """Get the sort order by sort_order_id."""
         return next((sort_order for sort_order in self.sort_orders if 
sort_order.order_id == sort_order_id), None)
 
+    @field_serializer('current_snapshot_id')
+    def serialize_current_snapshot_id(self, current_snapshot_id: 
Optional[int]) -> Optional[int]:
+        if current_snapshot_id is None and 
Config().get_bool("legacy-current-snapshot-id"):
+            return -1
+        return current_snapshot_id

Review Comment:
   Beautiful!



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

Reply via email to