-
-
Notifications
You must be signed in to change notification settings - Fork 336
(fix): ensure zip directory store compares key to prefix correctly #2758
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
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d80fb2c
(fix): ensure zip directory store compares key to prefix correctly
ilan-gold 16792ab
Merge branch 'main' into ig/fix_zip_store
ilan-gold f507fac
Merge branch 'main' into ig/fix_zip_store
ilan-gold d730dd2
(chore): add test for externally zipped zarr store
ilan-gold 0cd3733
Merge branch 'main' into ig/fix_zip_store
ilan-gold b69b3f0
(fix): no need for async test
ilan-gold b6fbf8e
(chore): rel note
ilan-gold 069d599
Merge branch 'main' into ig/fix_zip_store
ilan-gold c453bdf
Merge branch 'main' into ig/fix_zip_store
dcherian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fix zip-store path checking for stores with directories listed as files. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
There is a TON of this kind of thing already in this codebase. We need these things defined in the IO layer generally, not in individual implementations, as they all face similar problems.
Similarly, do we actually need a ZIP implementation when fsspec can do this for you?
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.
there have been a LOT of these string parsing bugs. it's a weak point in the codebase, and we definitely need something more solid!
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.
fsspec knows how you feel.
We can come up with a small number of string normalising functions that live on the Store baseclass, something like
os.path
, and normalise all user-passed strings at the first opportunity. This is what fsspec's _strip_protocol attempts, but also has problems.Uh oh!
There was an error while loading. Please reload this page.
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 did wonder how widespread this could be. I noticed this sort of thing in other stores but wasn't sure if there was knowledge that they were kosher (for whatever reason) within the maintainers (and therefore didn't need this sort of fix).
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.
The integration with backend IO libraries (fsspec and probably objstore) is particularly thorny, since they do their own path munging!
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.
What if we didn't represent prefixes as strings, but as tuples of strings instead? e.g. instead of
/foo/bar/baz
we would just have('', 'foo', 'bar','baz')
, which would be very easy to distinguish from('foo', 'bar', 'baz')
. Lets ignore for a second the profound disruption this would have on our store APIs.