Open ikrommyd opened 1 week ago
I think I commented on this elsewhere, but let me copy here for the record.
It seems that xrootd
doesn't implement _put_file
. It would maybe be reasonable to implement this upstream in a simplistic way for backends that don't have their own, but looking in put_file (in AbstractFileSystem) shows that there ought to be more going on, e.g., for callbacks.
--- a/fsspec/asyn.py
+++ b/fsspec/asyn.py
@@ -514,7 +514,8 @@ class AsyncFileSystem(AbstractFileSystem):
)
async def _put_file(self, lpath, rpath, **kwargs):
- raise NotImplementedError
+ data = open(lpath, "rb").read()
+ await self._pipe_file(rpath, data, **kwargs)
async def _put(
self,
@@ -591,7 +592,10 @@ class AsyncFileSystem(AbstractFileSystem):
)
async def _get_file(self, rpath, lpath, **kwargs):
- raise NotImplementedError
+ data = await self._cat_file(rpath, **kwargs)
+ with open(lpath, "wb") as f:
+ f.write(data)
Something like this to reproduce:
fails with:
I haven't tried with other types of remote paths. Perhaps there's a more general problem that isn't only xrootd+simplecache.