-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
I found that the current implementation of CachingFileSystem implicitly requires that the file object of wrapped fs uses the property .cache.
However, not all implementation uses the property .cache. I am currently facing an issue that the file object of WebdavFileSystem (from https://github.com/skshetry/webdav4) does overrides method .read() ignoring .cache. Because of that, nothing is cached when I wrap a WebdavFileSystem object with CachingFileSystem.
Lines 428 to 433 in e9b8fbd
| def read(self, length: int = -1) -> Union[str, bytes, None]: | |
| """Read chunk of bytes.""" | |
| chunk = self.reader.read(length) | |
| if chunk: | |
| self.loc += len(chunk) | |
| return chunk |
In my opinion, a wrapper like CachingFileSystem should not imply how the wrapped object works. Perhaps a more general solution should be implemented here?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels