Fokko commented on code in PR #245: URL: https://github.com/apache/iceberg-python/pull/245#discussion_r1498333203
########## pyiceberg/table/__init__.py: ########## @@ -871,6 +924,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) -> int: + """Return the highest assigned partition field ID across all specs for the table or 999 if there is no spec.""" + if self.metadata.last_partition_id: + return self.metadata.last_partition_id + return PARTITION_FIELD_ID_START - 1 Review Comment: In PyIceberg we treat all the tables internally as V2 tables. From the spec, it should start at 1000: <img width="702" alt="image" src="https://github.com/apache/iceberg-python/assets/1134248/e750ccea-20d7-4c37-acae-6a09c8feed4b"> -- 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