Skip to content

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

Merged
merged 5 commits into from
May 2, 2022
Merged

Accessor refactoring and CloudPath #59

merged 5 commits into from
May 2, 2022

Conversation

normanrz
Copy link
Collaborator

This PR refactors the _FSSpecAccessor to 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 S3Path and GCSPath classes into a CloudPath (could also be called CloudStoragePath, let me know what you prefer), because all their implementations were identical.

@normanrz normanrz requested a review from andrewfulton9 April 25, 2022 08:16
@normanrz normanrz self-assigned this Apr 25, 2022
Copy link
Contributor

@jstriebel jstriebel left a 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 👍

return wrapper
def touch(self, **kwargs):
kwargs.pop("trunicate", None)
self._accessor.touch(self, **kwargs)
Copy link
Contributor

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

Suggested change
self._accessor.touch(self, **kwargs)
super().touch(self, **kwargs)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

@jstriebel jstriebel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@normanrz normanrz merged commit fd10643 into main May 2, 2022
@normanrz normanrz deleted the explicit-accessor branch May 2, 2022 11:15
@ap-- ap-- mentioned this pull request Aug 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants