-
Notifications
You must be signed in to change notification settings - Fork 49
Accessor refactoring and CloudPath #59
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
Conversation
jstriebel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I like the simplifications! I was wondering if _FSSpecAccessor should even subclass fsspec.AbstractFileSystem directly, but since the methods needed are well known and only a few, I think the current version is more clear.
Please see my one comment below, besides this LGTM 👍
upath/implementations/hdfs.py
Outdated
| return wrapper | ||
| def touch(self, **kwargs): | ||
| kwargs.pop("trunicate", None) | ||
| self._accessor.touch(self, **kwargs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if there is self._accessor here? Shouldn't this rather be
| self._accessor.touch(self, **kwargs) | |
| super().touch(self, **kwargs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
jstriebel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
This PR refactors the
_FSSpecAccessorto work without__getattribute__magic. This makes it much easier to reason about the code while adding only a bit of boilerplate. In fact, it even decreases the lines of code.Addtionally, this PR merges the
S3PathandGCSPathclasses into aCloudPath(could also be calledCloudStoragePath, let me know what you prefer), because all their implementations were identical.