amogh-jahagirdar commented on code in PR #245:
URL: https://github.com/apache/iceberg-python/pull/245#discussion_r1479272548
##########
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:
We can't just return self.metadata.last_partition_id because that is
technically an optional type, but in practice will always be set due to our
model setting the value. I don't think we should change that because in V1 it
is technically optional, that's why we have our model set the value after words.
--
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]