diff --git a/pyiceberg/manifest.py b/pyiceberg/manifest.py index 362e9085df..a92d944811 100644 --- a/pyiceberg/manifest.py +++ b/pyiceberg/manifest.py @@ -866,6 +866,14 @@ def fetch_manifest_entry(self, io: FileIO, discard_deleted: bool = True) -> List if not discard_deleted or entry.status != ManifestEntryStatus.DELETED ] + def __eq__(self, other: Any) -> bool: + """Return the equality of two instances of the ManifestFile class.""" + return self.manifest_path == other.manifest_path if isinstance(other, ManifestFile) else False + + def __hash__(self) -> int: + """Return the hash of manifest_path.""" + return hash(self.manifest_path) + @cached(cache=LRUCache(maxsize=128), key=lambda io, manifest_list: hashkey(manifest_list)) def _manifests(io: FileIO, manifest_list: str) -> Tuple[ManifestFile, ...]: