Skip to content

Conversation

@andrewsg
Copy link
Contributor

@andrewsg andrewsg commented Sep 2, 2023

This adds support for XML MPU multiprocess uploads to Transfer Manager.

@andrewsg andrewsg added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Sep 2, 2023
@andrewsg andrewsg requested review from a team as code owners September 2, 2023 01:01
@product-auto-label product-auto-label bot added size: l Pull request size is large. api: storage Issues related to the googleapis/python-storage API. labels Sep 2, 2023
Copy link
Contributor

@cojenco cojenco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good 🎉 have a few questions

@andrewsg andrewsg removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Sep 7, 2023
@andrewsg
Copy link
Contributor Author

andrewsg commented Sep 7, 2023

Added integration tests. PTAL

@andrewsg
Copy link
Contributor Author

PTAL once more; this should be the final feature set I think

filename,
blob,
content_type=None,
chunk_size=TM_DEFAULT_CHUNK_SIZE,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is technically MPU part_size? Are using chunk_size for consistency?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is the part size. I am using chunk_size for consistency with the similar download method.

the documentation at https://cloud.google.com/storage/docs/multipart-uploads
before using this feature.
The library will attempt to cancel uploads that fail due to an exception.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Contributor

@danielduhh danielduhh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you planning to add the upload_sharded command name for metrics on in an other PR?

@andrewsg
Copy link
Contributor Author

@danielduhh Yes, actually that's already ready for review and I'll have it up as soon as this one is reviewed and merged.

Copy link
Contributor

@cojenco cojenco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just have two questions

return object_metadata

def _get_upload_arguments(self, client, content_type):
def _get_upload_arguments(self, client, content_type, filename=None):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm just a reminder there are changes in the tm-metrics branch relevant to this private method as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, already resolved via merge in a different branch

headers = {}
# Handle standard writable metadata
for key, value in metadata.items():
if key in METADATA_HEADER_TRANSLATION:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QQ are there any writable metadata fields that don't require translation?

Just wanted to make sure that they are all captured in _headers_from_metadata. If not, this works!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is the complete list according to the documentation. Note that custom metadata and some other features like encryption are not supported through this translation dictionary but handled differently.

@andrewsg andrewsg merged commit 56aeb87 into main Sep 18, 2023
@andrewsg andrewsg deleted the xml-mpu branch September 18, 2023 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: storage Issues related to the googleapis/python-storage API. size: l Pull request size is large.

3 participants