-
Notifications
You must be signed in to change notification settings - Fork 160
Chore: refactor blob.upload_from_file #1063
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
Chore: refactor blob.upload_from_file #1063
Conversation
MiaCY
commented
Jun 21, 2023
- Create new method blob._prep_and_do_upload
- Refactor business logic of blob.upload_from_file into blob._prep_and_do_upload
- Refactor blob.upload_from_file and blob.upload_from_filename to call blob._prep_and_do_upload
…rage into transfer_manager_usage_metrics
…nto transfer_manager_usage_metrics
…rage into transfer_manager_usage_metrics
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.
Oh, this is a straightforward and minimal approach. I think this is a good idea. Consider reducing the size of the private method's docstring a bit, possibly just by saying "see upload_from_file docstring for more info" if needed. Compare it to the other major private methods we have - is the docstring way too complex compared to those or is it similar? If it's similar or you think it would be confusing to reduce the size, we can just leave it as is.
I'm going to have to make unrelated changes to this area of the code soonish, so on the week of the 10th of July, let's look at merging the upload and download refactors into the main branch so there are no conflicts.
* Refactor client.download_blob_to_file * Chore: clean up code * refactor blob and client unit tests * lint reformat * Rename _prep_and_do_download * Refactor blob.upload_from_file * Lint reformat
* Chore: refactor client.download_blob_to_file (#1052) * Refactor client.download_blob_to_file * Chore: clean up code * refactor blob and client unit tests * lint reformat * Rename _prep_and_do_download * Chore: refactor blob.upload_from_file (#1063) * Refactor client.download_blob_to_file * Chore: clean up code * refactor blob and client unit tests * lint reformat * Rename _prep_and_do_download * Refactor blob.upload_from_file * Lint reformat * feature: add 'command' argument to private upload/download interface (#1082) * Refactor client.download_blob_to_file * Chore: clean up code * refactor blob and client unit tests * lint reformat * Rename _prep_and_do_download * Refactor blob.upload_from_file * Lint reformat * feature: add 'command' argument to private upload/download interface * lint reformat * reduce duplication and edit docstring * feat: add support for custom headers starting with metadata op * add custom headers to downloads in client blob modules * add custom headers to uploads with tests * update mocks and tests * test custom headers support tm mpu uploads * update tm test * update test --------- Co-authored-by: MiaCY <97990237+MiaCY@users.noreply.github.com>