10000 Inconsistent `listdir()` and `rmdir()` method signature across class hierarchy · Issue #890 · zarr-developers/zarr-python · GitHub
[go: up one dir, main page]

Skip to content
Inconsistent listdir() and rmdir() method signature across class hierarchy #890
Closed
@DimitriPapadopoulos

Description

@DimitriPapadopoulos

Problem description

The listdir() and rmdir() signatures are inconsistent across this class hierarchy:

BaseStore                             zarr/_storage/store.py
└── Store                             zarr/_storage/store.py
    ├── ABSStore                      zarr/_storage/absstore.py
    ├── MemoryStore                   zarr/storage.py
    ├── DirectoryStore                zarr/storage.py
    ├── FSStore                       zarr/storage.py
    ├── ZipStore                      zarr/storage.py
    ├── LRUStoreCache                 zarr/storage.py
    ├── SQLiteStore                   zarr/storage.py
    └── ConsolidatedMetadataStore     zarr/storage.py
class Store(BaseStore):
    [...]
    def listdir(self, path: str = "") -> List[str]:
    [...]
    def rmdir(self, path: str = "") -> None:
    [...]

class ABSStore(Store):
    [...]
    def listdir(self, path=None):
    [...]
    def rmdir(self, path=None):
    [...]

class MemoryStore(Store):
    [...]
    def listdir(self, path: Path = None) -> List[str]:
    [...]
    def rmdir(self, path: Path = None):
    [...]

class DirectoryStore(Store):
    [...]
    def listdir(self, path=None):
    [...]
    def rmdir(self, path=None):
    [...]

class FSStore(Store):
    [...]
    def listdir(self, path=None):
    [...]
    def rmdir(self, path=None):
    [...]

class ZipStore(Store):
    [...]
    def listdir(self, path=None):
    [...]

class LRUStoreCache(Store):
    [...]
    def listdir(self, path: Path = None):
    [...]

class SQLiteStore(Store):
    [...]
    def listdir(self, path=None):
    [...]
    def rmdir(self, path=None):
    [...]

class ConsolidatedMetadataStore(Store):
    [...]
    def listdir(self, path):
    [...]
  • Argument path should consistently be either a str or a Path
  • The default value of path should consistently be either "" or None.
  • ConsolidatedMetadataStore.listdir() needs a default value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0