diff --git a/pyiceberg/table/snapshots.py b/pyiceberg/table/snapshots.py index 07ca23a3b7..94df47f53c 100644 --- a/pyiceberg/table/snapshots.py +++ b/pyiceberg/table/snapshots.py @@ -230,12 +230,10 @@ def __eq__(self, other: Any) -> bool: @lru_cache -def _manifests(io: FileIO, manifest_list: Optional[str]) -> List[ManifestFile]: +def _manifests(io: FileIO, manifest_list: 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 [] + file = io.new_input(manifest_list) + return list(read_manifest_list(file)) class Snapshot(IcebergBaseModel): @@ -259,7 +257,9 @@ def __str__(self) -> str: def manifests(self, io: FileIO) -> List[ManifestFile]: """Return the manifests for the given snapshot.""" - return _manifests(io, self.manifest_list) + if self.manifest_list: + return _manifests(io, self.manifest_list) + return [] class MetadataLogEntry(IcebergBaseModel):