rambleraptor commented on code in PR #3991:
URL: https://github.com/apache/iceberg-python/pull/3991#discussion_r4040173813


##########
pyiceberg/manifest.py:
##########
@@ -975,8 +976,11 @@ def get_or_cache(self, manifest_file: ManifestFile) -> 
ManifestFile:
 
         with self._lock:
             manifest_path = manifest_file.manifest_path
-            if manifest_path in self._cache:
-                return self._cache[manifest_path]
+            cached = self._cache.get(manifest_path)
+            # ManifestFile equality compares manifest_path only, so fall back 
to the
+            # full record to guard against a path collision with different 
content.
+            if cached is not None and cached._data == manifest_file._data:

Review Comment:
   This seems like a particular expensive computation for cache misses. 



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