-
-
Notifications
You must be signed in to change notification settings - Fork 307
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
Normalize paths when creating StorePath #2850
base: main
Are you sure you want to change the base?
Conversation
The spec controls the characters that can be used, and the "separator" is configurable, so I'm finding it hard to see what other axis of flexbility exists. zarr-python/src/zarr/testing/strategies.py Lines 79 to 89 in e8bfb64
|
different key-value storage backends can set different rules about what keys are allowed. e.g., s3 and OSX might have different rules about file name length. It's not terrible if we end up parsing paths twice, but if there's a bug in one parsing path or the other, it would be annoying to look in two different classes to find that bug. I guess my broader complaint is that |
In main we don't normalize paths when constructing an instance of
StorePath
, which means it's possible to create groups with names likea//b
. This PR fixes this behavior by ensuring that thepath
attribute ofStorePath
is normalized withnormalize_path
inStorePath.__init__
.There is potentially a problem here if different store classes have different rules about path names. This argues against the existence of a separate
StorePath
class, and in favor of allowingStore
instances to manage their current path.