-
Notifications
You must be signed in to change notification settings - Fork 9
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
External resource updates #257
Conversation
Also fixes file copying when copying to a nested directory
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #257 +/- ##
=======================================
Coverage 99.20% 99.20%
=======================================
Files 36 36
Lines 1893 1898 +5
=======================================
+ Hits 1878 1883 +5
Misses 15 15 ☔ View full report in Codecov by Sentry. |
@@ -20,6 +20,12 @@ def __init__(self, root_dir: Union[pathlib.Path, str]): | |||
def _exists(self, location): | |||
return self._as_path(location).exists() | |||
|
|||
def __eq__(self, other): | |||
return ( | |||
isinstance(other, FileStorage) |
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.
a bit nickpicky, but technically objects are meant to return NotImplemented
in this case, so that the other object can have a shot at defining __eq__
, see https://stackoverflow.com/a/42588737
@@ -26,6 +26,9 @@ def _delete(self, location): | |||
f"Unable to delete '{location}': key does not exist" | |||
) | |||
|
|||
def __eq__(self, other): | |||
return self is other |
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.
iirc this is the default object behaviour, but I guess it isn't harming anyone having it here
Two things here:
ExternalResource
sFileStorage
into a nested directory.These were part of the overall work I've been doing on StagingPaths and the bigger storage tasks, but this is a small, self-contained PR that can be reviewed pretty easily. I thought it might be easier to review this first.