amogh-jahagirdar commented on code in PR #245:
URL: https://github.com/apache/iceberg-python/pull/245#discussion_r1477705066


##########
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:
   I was thinking about that but wasn't sure about breaking API behavior which 
is why I added a new API. If we have the flexibility here to change the API we 
should do that. I think we can because arguably it's incorrect to return 1000 
for an unpartitioned table so it's really a fix.



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

Reply via email to