Skip to content

Commit

Permalink
Fix new MyPy issues
Browse files Browse the repository at this point in the history
Left operand of "or" is always false  [redundant-expr]
  • Loading branch information
DimitriPapadopoulos committed Mar 12, 2024
1 parent 1ca7b7d commit a116827
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion zarr/_storage/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def _valid_key(self, key: str) -> bool:
0-9, or in the set /.-_ it will return True if that's the case, False
otherwise.
"""
if not isinstance(key, str) or not key.isascii():
if not isinstance(key, str) or not key.isascii(): # type: ignore[redundant-expr]
return False
if set(key) - self._valid_key_characters:
return False
Expand Down
2 changes: 2 additions & 0 deletions zarr/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -2501,6 +2501,8 @@ def _accommodate_value(self, value_size):
self._current_size -= buffer_size(v)

def _cache_value(self, key: Path, value):
if self._max_size is None:
return
# cache a value
value_size = buffer_size(value)
# check size of the value against max size, as if the value itself exceeds max
Expand Down

0 comments on commit a116827

Please sign in to comment.