-
-
Notifications
You must be signed in to change notification settings - Fork 329
Consistent signatures for listdir()
and rmdir()
#903
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
Consistent signatures for listdir()
and rmdir()
#903
Conversation
4010b32
to
6be2a17
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #903 +/- ##
=======================================
Coverage 99.94% 99.94%
=======================================
Files 32 32
Lines 11218 11218
=======================================
Hits 11212 11212
Misses 6 6
|
6dc45a5
to
a48da3b
Compare
a48da3b
to
86ea815
Compare
It works by changing the type of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few thoughts, but this one may need a few more eyes on it.
@@ -168,3 +160,11 @@ def _listdir_from_keys(store: BaseStore, path: Optional[str] = None) -> List[str | |||
child = suffix.split('/')[0] | |||
children.add(child) | |||
return sorted(children) | |||
|
|||
|
|||
def _rmdir_from_keys(store: Union[BaseStore, MutableMapping], path: Optional[str] = None) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did this need to shift down?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's just the order used everywhere else in the code: 1) listdir 2) rmdir
@@ -128,7 +128,7 @@ def normalize_store_arg(store: Any, clobber=False, storage_options=None, mode="w | |||
return store | |||
|
|||
|
|||
def rmdir(store: StoreLike, path: Path = None): | |||
def rmdir(store: StoreLike, path: str = None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might need some comparison to #768
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a look at #768:
- I understand it would be nice if
path
could bePathLike
in addition tostr
, wouldn't it? - BTW, I would rename
_might_close()
to_is_path_like()
, it's easier to understand because that's really what the function is about.
I'm going to close this as stale. Folks should feel free to reopen if there is interest in continuing this work but understand that the Store API has changed significantly in v3. |
Fixes #890.
TODO: