Fokko commented on code in PR #787:
URL: https://github.com/apache/iceberg-python/pull/787#discussion_r1632590946


##########
pyiceberg/table/snapshots.py:
##########
@@ -228,6 +229,15 @@ def __eq__(self, other: Any) -> bool:
         )
 
 
+@lru_cache
+def _manifests(io: FileIO, manifest_list: Optional[str]) -> List[ManifestFile]:
+    """Return the manifests from the manifest list."""
+    if manifest_list not in (None, ""):
+        file = io.new_input(manifest_list)  # type: ignore
+        return list(read_manifest_list(file))
+    return []

Review Comment:
   I think this is the more pythonic way:
   ```suggestion
       if manifest_list:
   ```
   Maybe better to do this check around line 260, and change the signature in:
   ```suggestion
   def _manifests(io: FileIO, manifest_list: str) -> List[ManifestFile]:
       """Return the manifests from the manifest list."""
       file = io.new_input(manifest_list)  # type: ignore
       return list(read_manifest_list(file))
   ```



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to