Store prefix does not always follow str typing
#499
|
It's currently possible to use a PosixPath for the prefix when creating a store, which is also used for the store's prefix attribute. This is causing some difficulties in VirtualiZarr since it's harder to reason about relative paths and we cannot rely on import obstore
from pathlib import Path
file_url = "../../../../../../private/var/folders/70/hc_nynms54d8lp67z4rsfctc0000gp/T/pytest-of-max/pytest-13/test_convert_relative_paths_to0/air.nc"
path = Path(file_url)
store = LocalStore(prefix=path.parent)
print(store.prefix) |
Answered by
kylebarron
Jul 16, 2025
Replies: 1 comment 6 replies
|
It's intentional for
You can call |
6 replies
Answer selected by
maxrjones
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's intentional for
LocalStore.prefixto be aPathbecause that's the most appropriate type to represent a path on a local disk. We could potentially canonicalize the path so it's not relative.You can call
str(path)...?