We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Async functions should not open files with blocking methods like open.
open
obstore/obstore/python/obstore/fsspec.py
Lines 195 to 198 in 9ca85e7
Lines 201 to 206 in 9ca85e7
Instead we should use something like:
async def _put_file( self, lpath: str, rpath: str, mode: str = "overwrite", # noqa: ARG002 **_kwargs: Any, ) -> None: local_store = LocalStore("/") local_file = await obs.get_async(local_store, lpath) await obs.put_async(self.store, rpath, local_file)
We may want to cache the construction of LocalStore("/")? It looks like constructing that only takes 1.22 μs on my machine, so maybe not important.
LocalStore("/")
1.22 μs
It looks like the leading "/" on a path is not an issue. I.e. this works even though there's a leading "/" in the path:
"/"
lpath = "/Users/kyle/github/developmentseed/obstore/README.md" local_store = LocalStore("/") local_file = obs.get(local_store, lpath) print(local_file.bytes().to_bytes().decode())
This may deadlock in the case that the async implementation is used synchronously, but that's something we can come back to in the future.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Async functions should not open files with blocking methods like
open
.obstore/obstore/python/obstore/fsspec.py
Lines 195 to 198 in 9ca85e7
obstore/obstore/python/obstore/fsspec.py
Lines 201 to 206 in 9ca85e7
Instead we should use something like:
We may want to cache the construction of
LocalStore("/")
? It looks like constructing that only takes1.22 μs
on my machine, so maybe not important.It looks like the leading
"/"
on a path is not an issue. I.e. this works even though there's a leading"/"
in the path:This may deadlock in the case that the async implementation is used synchronously, but that's something we can come back to in the future.
The text was updated successfully, but these errors were encountered: