-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Refactor/s3 copy #2508
Refactor/s3 copy #2508
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.
While your objective is completed (to separate out copy functionality into helper methods), the current state of the helper methods becomes hard to use due to the massive amount of required args.
Can you see about making the scheme more flexible?
Build errors appear to have been a Travis issue as they have since resolved without change on our end. |
This reverts commit 10d3ab4.
bb60b47
to
31d8da4
Compare
I have made the changes suggested by @dlstadther. Please take a look. |
While I was doing the previous changes I that we are sending to |
Another thing is that I think copy nested directories are not supported, would that be desirable? |
I agree on supplying
|
Changes committed. @dlstadther Let me know what do you think? |
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.
Everything else LGTM
Feel free to ignore my one last improvement request. They're both correct, one is just shorter and more clear the than other.
|
||
(src_bucket, src_key) = self._path_to_bucket_and_key(source_path) | ||
(dst_bucket, dst_key) = self._path_to_bucket_and_key(destination_path) | ||
|
||
# don't allow threads to be less than 3 | ||
threads = 3 if threads < 3 else threads |
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 wrote this line long ago and have always wanted to update it to threads = max(threads, 3)
. This PR seems appropriate since you've already modified other code in this method
* upstream-master: Add Python 3.7 compatibility (spotify#2466) Refactor s3 copy into sub-methods (spotify#2508) Remove s3 bucket validation prior to file upload (spotify#2528) Version 2.7.9 set upper bound of python-daemon Update MockTarget mode to accept r* or w* (spotify#2519)
Description
Extract copy directory and copy file logic out of copy function in S3 client.
Motivation and Context
Is just a small refactor over copy function for having more readability and reuse copy file logic also in copy directory.
The idea came by reviewing this PR: #2488
Have you tested this? If so, how?
I didn't change any behaviour so tests remain the same.