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)
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
It's intentional for
You can call |
Beta Was this translation helpful? Give feedback.
It's intentional for
LocalStore.prefix
to be aPath
because 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)
...?