Skip to content

Commit d425945

Browse files
committed
Fix DirectoryStore's __eq__ method
Make sure to compare `DirectoryStore`'s contents if their paths differ instead of just returning `False`.
1 parent 33fe925 commit d425945

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

‎zarr/storage.py‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -781,10 +781,12 @@ def __contains__(self, key):
781781
return os.path.isfile(file_path)
782782

783783
def __eq__(self, other):
784-
return (
785-
isinstance(other, DirectoryStore) and
786-
self.path == other.path
787-
)
784+
if not isinstance(other, DirectoryStore):
785+
return False
786+
elif self.path == other.path:
787+
return True
788+
else:
789+
return super(DirectoryStore, self).__eq__(other)
788790

789791
def keys(self):
790792
if os.path.exists(self.path):

0 commit comments

Comments
 (0)