ForeverAngry commented on code in PR #2143:
URL: https://github.com/apache/iceberg-python/pull/2143#discussion_r2191172858


##########
pyiceberg/table/inspect.py:
##########
@@ -668,10 +666,20 @@ def data_files(self, snapshot_id: Optional[int] = None) 
-> "pa.Table":
     def delete_files(self, snapshot_id: Optional[int] = None) -> "pa.Table":
         return self._files(snapshot_id, {DataFileContent.POSITION_DELETES, 
DataFileContent.EQUALITY_DELETES})
 
-    def all_manifests(self) -> "pa.Table":
+    def all_manifests(self, snapshots: Optional[Union[list[Snapshot], 
list[int]]] = None) -> "pa.Table":
         import pyarrow as pa
 
-        snapshots = self.tbl.snapshots()
+        # coerce into snapshot objects if users passes in snapshot ids
+        if snapshots is not None:
+            if isinstance(snapshots[0], int):
+                snapshots = [
+                    snapshot
+                    for snapshot_id in snapshots
+                    if (snapshot := 
self.tbl.metadata.snapshot_by_id(snapshot_id)) is not None
+                ]
+        else:
+            snapshots = self.tbl.snapshots()
+

Review Comment:
   tl;dr 
   Sounds good ill make the change!
   
   I originally forked your branch so I could stack my PR on your “Delete 
Orphans” PR. As July began, my schedule looked pretty rough, so I converted my 
draft into a PR against the main pyiceberg branch—since I wasn’t sure how much 
time I’d have later in the month—but I forgot to rebase. As a result, I 
inadvertently removed the code for deleting orphans while keeping your 
MaintenanceTable implementation in a more… manual way 😟, so there may still be 
some remnants. They say the best form of flattery is imitation 😉. 



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