ebyhr commented on code in PR #3725:
URL: https://github.com/apache/iceberg-python/pull/3725#discussion_r3717032475


##########
pyiceberg/table/inspect.py:
##########
@@ -65,6 +65,13 @@ def _get_snapshot(self, snapshot_id: int | None = None) -> 
Snapshot:
         else:
             raise ValueError("Cannot get a snapshot as the table does not have 
any.")
 
+    def _get_snapshots_by_id(self) -> dict[int, Snapshot]:
+        """Index the snapshots by ID, for methods that look up many of them.
+
+        snapshot_by_id is a linear scan, so calling it once per row is 
quadratic.

Review Comment:
   > snapshot_by_id is a linear scan, so calling it once per row is quadratic.
   
   That's explaining why the caller was slow, not what the function does. We 
could remove this sentence. 



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