-
-
Notifications
You must be signed in to change notification settings - Fork 304
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
Use removeprefix rather than replace to avoid separator deletion #2778
base: main
Are you sure you want to change the base?
Use removeprefix rather than replace to avoid separator deletion #2778
Conversation
22c3a69
to
90812f5
Compare
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.
Thansk a lot, code change looks 👍
Could you add a test using an example that would have failed before this change to make sure this doesn't fail in the future?
seconding this request -- the real bug is the hole in our test suite |
Test added. Seems like a fairly general behavior but it wasn't obvious that there was a more abstract way to add it, so I opted for covering just the EDIT: This comment is braindead. Pushing things up to the generic store tests as described below |
those tests look good. if it's not too much work, you could consider adding them to the store test base class (the relevant lines are here: zarr-python/src/zarr/testing/store.py Lines 368 to 421 in fc08f31
|
d0134ce
to
45447af
Compare
Good call. This was obviously the right place to test things |
The point of replace here is just to remove the prefix instance but it has the unintended consequence of deleting separators when path is the empty string. This uses
removeprefix
explicitly and avoids that potential pitfallFixes #2777
TODO:
docs/user-guide/*.rst
changes/