-
Notifications
You must be signed in to change notification settings - Fork 63
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
Some libraries generate confusing errors when opening CloudPath objects #315
Comments
There aren't great options here. This is what I see. Open to other options if people have them. Maybe some combination of these are good mitigations. Stop being
|
Just to add that the workaroud is for the user to pass |
Good point, thanks for adding! |
FWIW I'm working on adding a def do_thing(path):
if not isinstance(path, pathlib.AbstractPath):
path = pathlib.Path(path)
with path.open('rb') as f:
... In this way, functions can accept string paths, FWIW, I'm also planning to make |
Thanks @barneygale! Yes, we'd support having a way to signal Will Let me know if we can help testing or reviewing anything there. (That said, this still puts us in the "get other library maintainers to rewrite their code to use/support |
I'm not planning to change anything about I think it's a losing game trying to provide |
The main problem is the libs based on opening files with
fsspec
won't work properly withCloudPaths
.They will call
fspath
to resolve it (instead of str()) and therefore the file called will be cached (this is not exaclty what we want, and this will be done silently)For single files like
tif
this will be not optimal but will work (your example)But for nested files likes VRT, this will crash as only the header is cached and not the relative files. This will break the paths inside the VRT.
Note that GDAL (and therefore rasterio) can read VRT stored on the cloud, and this is the expected behavior.
A little example:
Originally posted by @remi-braun in #96 (comment)
The text was updated successfully, but these errors were encountered: