-
Notifications
You must be signed in to change notification settings - Fork 77
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
[SVCS-552] folder_file_op cut down revalidate calls. #311
base: develop
Are you sure you want to change the base?
Changes from 1 commit
aaff576
bf5f9e3
a27b568
63825aa
b61b2ec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,14 +5,18 @@ | |
|
||
class BaseCloudFilesMetadata(metadata.BaseMetadata): | ||
|
||
@property | ||
def id(self): | ||
return self.path | ||
|
||
@property | ||
def provider(self): | ||
return 'cloudfiles' | ||
|
||
# CloudFiles is a path-based provider. However, it never called ``revalidate_path()`` even when | ||
# it was the backend storage provider for OSFStorage. The provider is no longer active until it | ||
# is upgraded to an addon provider for the users. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See GoogleCloud. |
||
@property | ||
def id(self): | ||
# TODO: Do we need this ``id`` to be actually set? | ||
return self.path | ||
|
||
|
||
class CloudFilesFileMetadata(BaseCloudFilesMetadata, metadata.BaseFileMetadata): | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,14 +3,18 @@ | |
|
||
class BaseDataverseMetadata(metadata.BaseMetadata): | ||
|
||
@property | ||
def id(self): | ||
return str(self.raw['id']) | ||
|
||
@property | ||
def provider(self): | ||
return 'dataverse' | ||
|
||
# TODO: Should this be in ``DataverseFileMetadata``? | ||
# TODO: Does ``self.raw['id']`` exists for ``DataverseDatasetMetadata``? | ||
# TODO: DataVerse's ``revalidate_path()`` looks very different. Is this an issue? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar to GitHub, your fix calls (functionally, not literally) |
||
# DataVerse is an id-based provider and has its own ``revalidate_path()``. | ||
@property | ||
def id(self): | ||
return str(self.raw['id']) | ||
|
||
|
||
class DataverseFileMetadata(BaseDataverseMetadata, metadata.BaseFileMetadata): | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,14 +9,16 @@ def __init__(self, raw, folder): | |
super().__init__(raw) | ||
self._folder = folder | ||
|
||
@property | ||
def id(self): | ||
return self.raw['id'] | ||
|
||
@property | ||
def provider(self): | ||
return 'dropbox' | ||
|
||
# TODO: Is Dropbox path-based instead of id-based? | ||
# TODO: Dropbox does not have a ``revalidate_path()``, should we use path instead of id? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no |
||
@property | ||
def id(self): | ||
return self.raw['id'] | ||
|
||
def build_path(self, path): | ||
# TODO write a test for this | ||
if path.lower().startswith(self._folder.lower()): | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,14 +19,16 @@ def __init__(self, raw, commit=None, ref=None): | |
self.commit = commit | ||
self.ref = ref | ||
|
||
@property | ||
def id(self): | ||
return self.path | ||
|
||
@property | ||
def provider(self): | ||
return 'github' | ||
|
||
# GitHub is a path-based provider. However, it has its own ``revalidate_path()``. | ||
# TODO: Investigate if this is an issue. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. GitHub may not work because your fix calls (functionally, not literally) the default |
||
@property | ||
def id(self): | ||
return self.path | ||
|
||
@property | ||
def extra(self): | ||
ret = {} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,8 +27,11 @@ class BaseGoogleCloudMetadata(metadata.BaseMetadata, metaclass=abc.ABCMeta): | |
def provider(self) -> str: | ||
return 'googlecloud' | ||
|
||
# GoogleCloud is a path-based provider. However, it never calls ``revalidate_path()`` since it | ||
# is the backend storage provider for OSFStorage. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar to CloudFiles (when it was the storage provider), GoogleCloud never uses |
||
@property | ||
def id(self) -> str: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add GoogleCloud to pass tests. |
||
# TODO: Do we need this ``id`` to be actually set? | ||
return self.path | ||
|
||
@property | ||
|
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.
Please update the DocStr to mention what this
id
is for both types.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.