jayceslesar commented on code in PR #1608:
URL: https://github.com/apache/iceberg-python/pull/1608#discussion_r2173826903


##########
pyiceberg/table/inspect.py:
##########
@@ -704,3 +731,30 @@ def all_data_files(self) -> "pa.Table":
 
     def all_delete_files(self) -> "pa.Table":
         return self._all_files({DataFileContent.POSITION_DELETES, 
DataFileContent.EQUALITY_DELETES})
+
+    def all_entries(self) -> "pa.Table":
+        import pyarrow as pa
+
+        snapshots = self.tbl.snapshots()
+        if not snapshots:
+            return pa.Table.from_pylist([], self._get_entries_schema())
+
+        schemas = self.tbl.schemas()
+        snapshot_schemas: Dict[int, "pa.Schema"] = {}
+        for snapshot in snapshots:
+            if snapshot.schema_id is None:
+                raise ValueError(f"Cannot find schema_id for snapshot: 
{snapshot.snapshot_id}")
+            else:
+                snapshot_schemas[snapshot.snapshot_id] = 
schemas.get(snapshot.schema_id)
+
+        executor = ExecutorFactory.get_or_create()
+        all_manifests: Iterator[List[ManifestFile]] = executor.map(lambda 
snapshot: snapshot.manifests(self.tbl.io), snapshots)
+        unique_flattened_manifests = list(
+            {manifest.manifest_path: manifest for manifest_list in 
all_manifests for manifest in manifest_list}.values()
+        )
+

Review Comment:
   can we use the `all_manifests` method of the `InspectTable` class instead of 
"re-defining" it to get the `unique_flattened_manifests` ?



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