From 932329f20833dd0eaf5601d07eb7ffe91cc97aac Mon Sep 17 00:00:00 2001 From: Charoula-Kyriakides <92877693+Charoula-Kyriakides@users.noreply.github.com> Date: Sat, 13 Apr 2024 01:30:37 +0100 Subject: [PATCH 1/2] LocalStore__eq__ #1744 Fix equality comparison in LocalStore class by implementing __eq__ method --- src/zarr/v3/store/local.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/zarr/v3/store/local.py b/src/zarr/v3/store/local.py index 5d22b30e9a..2115dc2eed 100644 --- a/src/zarr/v3/store/local.py +++ b/src/zarr/v3/store/local.py @@ -67,6 +67,9 @@ def __str__(self) -> str: def __repr__(self) -> str: return f"LocalStore({repr(str(self))})" + def __eq__(self, other: 'LocalStore') -> bool: + return isinstance(other, type(self)) and self.root == other.root + async def get( self, key: str, byte_range: Optional[Tuple[int, Optional[int]]] = None ) -> Optional[bytes]: From a79b2c9d9b4ea36ba91c8826c46e31331493efdb Mon Sep 17 00:00:00 2001 From: Charoula-Kyriakides <92877693+Charoula-Kyriakides@users.noreply.github.com> Date: Thu, 18 Apr 2024 15:48:45 +0100 Subject: [PATCH 2/2] Update src/zarr/v3/store/local.py Changed 'LocalStore' to object in __eq__ Co-authored-by: Davis Bennett --- src/zarr/v3/store/local.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zarr/v3/store/local.py b/src/zarr/v3/store/local.py index 2115dc2eed..8f02b904c0 100644 --- a/src/zarr/v3/store/local.py +++ b/src/zarr/v3/store/local.py @@ -67,7 +67,7 @@ def __str__(self) -> str: def __repr__(self) -> str: return f"LocalStore({repr(str(self))})" - def __eq__(self, other: 'LocalStore') -> bool: + def __eq__(self, other: object) -> bool: return isinstance(other, type(self)) and self.root == other.root async def get(