| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
| .. _API reference: https://cloud.google.com/storage/\ | ||
| docs/json_api/v1/objects | ||
| """ | ||
| # NOTE: This assumes `self.name` is unicode. |
| * An object metadata dictionary | ||
| * The ``content_type`` as a string (according to precedence) | ||
| """ | ||
| transport = self._make_transport(client) |
| def _do_multipart_upload(self, client, stream, content_type, size): | ||
| """Perform a multipart upload. | ||
|
|
||
| Assumes ``chunk_size`` is :data:`None` on the current blob. |
| upload.initiate( | ||
| transport, stream, object_metadata, content_type, | ||
| total_bytes=size, stream_final=False) | ||
| while not upload.finished: |
| content_type = self._get_content_type(content_type, filename=filename) | ||
|
|
||
| with open(filename, 'rb') as file_obj: | ||
| total_bytes = os.fstat(file_obj.fileno()).st_size |
|
Overall this looks fine, just some small concerns.
Do you plan to address those in this PR?
Will you file a bug to track that, or do you have confidence you won't forget?
I'm okay with this.
Do it. File a bug if needed to track. |
Sorry, something went wrong.
Absolutely.
I realized that I would go below 100% line coverage in the _create_upload function if I left that alone. Since _create_upload needs to go anyways, I will just make the create_resumable_upload_session in this PR (rather than fighting coverage).
You mean like do it in this PR? |
Sorry, something went wrong.
Your call. |
Sorry, something went wrong.
In addition, switched over Blob.create_resumable_upload_session() to use google-resumable-media instead of using the vendored in `google.cloud.streaming` package.
| extra_headers=extra_headers) | ||
| curr_chunk_size = self.chunk_size | ||
| try: | ||
| # Temporarily patch the chunk size. A user should still be able |
This is to avoid monkey-patching the instance when "pure" behavior will suffice. Also removed the transport from Blob._get_upload_arguments().
|
Merging this now after discussions with @lukesneeringer and @jonparrott. This needs a follow-up PR ASAP that supports num_retries, so I will be working on that. |
Sorry, something went wrong.
…() methods to use google-resumable-media. (#3362)
| Back | FazBrowse Home | New Git URL |
Some notes: