amogh-jahagirdar commented on code in PR #245: URL: https://github.com/apache/iceberg-python/pull/245#discussion_r1475567295
########## pyiceberg/table/__init__.py: ########## @@ -868,6 +919,12 @@ def sort_orders(self) -> Dict[int, SortOrder]: """Return a dict of the sort orders of this table.""" return {sort_order.order_id: sort_order for sort_order in self.metadata.sort_orders} + def last_partition_id(self) -> Optional[int]: + """Return the highest assigned partition field ID across all specs for the table or None if the table is unpartitioned and there are no specs.""" + if len(self.specs()) == 1 and self.spec().is_unpartitioned(): + return None + return self.metadata.last_partition_id Review Comment: @Fokko @HonahX I added this API to the `Table` since we'll need it in the implementation and we don't want to directly access `TableMetadata` let me know what 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-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org