Skip to content

Fix merge conflicts for V3 typing any generics #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions src/zarr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
from zarr.errors import CopyError, MetadataError
from zarr.hierarchy import Group, group, open_group
from zarr.n5 import N5Store, N5FSStore
from zarr._storage.store import v3_api_available
from zarr.storage import (
ABSStore,
DBMStore,
Expand All @@ -53,18 +52,3 @@

# in case setuptools scm screw up and find version to be 0.0.0
assert not __version__.startswith("0.0.0")

if v3_api_available:
from zarr._storage.v3 import (
ABSStoreV3,
DBMStoreV3,
KVStoreV3,
DirectoryStoreV3,
LMDBStoreV3,
LRUStoreCacheV3,
MemoryStoreV3,
MongoDBStoreV3,
RedisStoreV3,
SQLiteStoreV3,
ZipStoreV3,
)
55 changes: 1 addition & 54 deletions src/zarr/_storage/absstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import warnings
from numcodecs.compat import ensure_bytes
from zarr.util import normalize_storage_path
from zarr._storage.store import _get_metadata_suffix, data_root, meta_root, Store, StoreV3
from zarr._storage.store import Store

__doctest_requires__ = {
("ABSStore", "ABSStore.*"): ["azure.storage.blob"],
Expand Down Expand Up @@ -222,56 +222,3 @@ def getsize(self, path=None):

def clear(self):
self.rmdir()


class ABSStoreV3(ABSStore, StoreV3):
def list(self):
return list(self.keys())

def __eq__(self, other):
return (
isinstance(other, ABSStoreV3)
and self.client == other.client
and self.prefix == other.prefix
)

def __setitem__(self, key, value):
self._validate_key(key)
super().__setitem__(key, value)

def rmdir(self, path=None):
if not path:
# Currently allowing clear to delete everything as in v2

# If we disallow an empty path then we will need to modify
# TestABSStoreV3 to have the create_store method use a prefix.
ABSStore.rmdir(self, "")
return

meta_dir = meta_root + path
meta_dir = meta_dir.rstrip("/")
ABSStore.rmdir(self, meta_dir)

# remove data folder
data_dir = data_root + path
data_dir = data_dir.rstrip("/")
ABSStore.rmdir(self, data_dir)

# remove metadata files
sfx = _get_metadata_suffix(self)
array_meta_file = meta_dir + ".array" + sfx
if array_meta_file in self:
del self[array_meta_file]
group_meta_file = meta_dir + ".group" + sfx
if group_meta_file in self:
del self[group_meta_file]

# TODO: adapt the v2 getsize method to work for v3
# For now, calling the generic keys-based _getsize
def getsize(self, path=None):
from zarr.storage import _getsize # avoid circular import

return _getsize(self, path)


ABSStoreV3.__doc__ = ABSStore.__doc__
Loading