-
Notifications
You must be signed in to change notification settings - Fork 7
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
Allow MemoryFileStore store copying from different a bucket #68
base: main
Are you sure you want to change the base?
Allow MemoryFileStore store copying from different a bucket #68
Conversation
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 think this is going along the right direction. I have a few comments left.
@@ -1396,8 +1396,9 @@ def list_s3_keys(self, namespace: str = "") -> Iterable[S3Object]: | |||
return [self.get_key(path) for path in self.list_files(namespace=namespace)] | |||
|
|||
def copy(self, *, s3_object: S3Object, destination: str) -> S3Object: | |||
source_bucket = self.buffers[s3_object.bucket_name] |
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.
📚📚📚 Shall we add a docstring to the function?
bucket_name=source_bucket_name, | ||
key=source_key_path, | ||
) | ||
destination = "a/b/c.pdf" |
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.
🐼 Since the original key path is called source_key_path
, shall we rename this as destination_key_path
?
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.
🐼 There is a nice PR description, shall we copy that as detailed explanatory text into the commit message?
Only truly trivial changes should have a one-line commit message, see: standard commit message format.
Prior to this PR it was not possible to copy a file from one bucket to another in the
MemoryFileStore
like what can be done with theS3FileStore
. Because theMemoryFileStore
doesn't support copying a file from a different bucket, theMemoryFileStore
cannot be used as an analogous replacement for the S3FileStoreThis change updates the
MemoryFileStore
copy method to allow copying from one bucket to another to match theS3FileStore
behaviour.