Skip to content

Commit 5ee391d

Browse files
release-please[bot]gcf-owl-bot[bot]chandra-siri
authored
chore(main): release 3.4.1 (#1552)
* chore(main): release 3.4.1 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Update CHANGELOG.md Don't bump minor version for experimental changes. * Update just the minor version. Update just the minor version. Don't update minor version for experimental features. * Update version.py from 3.5.0 to 3.4.1 Update just the patch version. Don't update (bump up) minor version for experimental features. --------- Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Chandra Shekhar Sirimala <chandrasiri@google.com>
1 parent acb918e commit 5ee391d

File tree

6 files changed

+49
-31
lines changed

6 files changed

+49
-31
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44

55
[1]: https://pypi.org/project/google-cloud-storage/#history
66

7+
## [3.4.1](https://github.com/googleapis/python-storage/compare/v3.4.0...v3.5.0) (2025-10-08)
8+
9+
### Bug Fixes
10+
11+
* Fixes [#1561](https://github.com/googleapis/python-storage/issues/1561) by adding an option to specify the entire object checksum for resumable uploads via the `upload_from_string`, `upload_from_file`, and `upload_from_filename` methods ([acb918e](https://github.com/googleapis/python-storage/commit/acb918e20f7092e13d72fc63fe4ae2560bfecd40))
12+
713
## [3.4.0](https://github.com/googleapis/python-storage/compare/v3.3.1...v3.4.0) (2025-09-15)
814

915

google/cloud/storage/blob.py

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ def __init__(
235235

236236
if generation is not None:
237237
self._properties["generation"] = generation
238+
238239
@property
239240
def bucket(self):
240241
"""Bucket which contains the object.
@@ -2178,12 +2179,12 @@ def _initiate_resumable_upload(
21782179
unless otherwise directed.
21792180
21802181
:type crc32c_checksum_value: str
2181-
:param crc32c_checksum_value: (Optional) This should be the checksum of
2182+
:param crc32c_checksum_value: (Optional) This should be the checksum of
21822183
the entire contents of `file`. Applicable while uploading object
21832184
greater than `_MAX_MULTIPART_SIZE` bytes.
21842185
21852186
It can be obtained by running
2186-
2187+
21872188
`gcloud storage hash /path/to/your/file`
21882189
21892190
or
@@ -2204,7 +2205,7 @@ def _initiate_resumable_upload(
22042205
22052206
Above code block prints 8 char string of base64 encoded big-endian
22062207
bytes of 32 bit CRC32c integer.
2207-
2208+
22082209
More details on CRC32c can be found in Appendix B:
22092210
https://datatracker.ietf.org/doc/html/rfc4960#appendix-B and
22102211
base64: https://datatracker.ietf.org/doc/html/rfc4648#section-4
@@ -2396,12 +2397,12 @@ def _do_resumable_upload(
23962397
unless otherwise directed.
23972398
23982399
:type crc32c_checksum_value: str
2399-
:param crc32c_checksum_value: (Optional) This should be the checksum of
2400+
:param crc32c_checksum_value: (Optional) This should be the checksum of
24002401
the entire contents of `stream`. Applicable while uploading object
24012402
greater than `_MAX_MULTIPART_SIZE` bytes.
24022403
24032404
It can be obtained by running
2404-
2405+
24052406
`gcloud storage hash /path/to/your/file`
24062407
24072408
or
@@ -2422,7 +2423,7 @@ def _do_resumable_upload(
24222423
24232424
Above code block prints 8 char string of base64 encoded big-endian
24242425
bytes of 32 bit CRC32c integer.
2425-
2426+
24262427
More details on CRC32c can be found in Appendix B:
24272428
https://datatracker.ietf.org/doc/html/rfc4960#appendix-B and
24282429
base64: https://datatracker.ietf.org/doc/html/rfc4648#section-4
@@ -2578,12 +2579,12 @@ def _do_upload(
25782579
unless otherwise directed.
25792580
25802581
:type crc32c_checksum_value: str
2581-
:param crc32c_checksum_value: (Optional) This should be the checksum of
2582+
:param crc32c_checksum_value: (Optional) This should be the checksum of
25822583
the entire contents of `file_obj`. Applicable while uploading object
25832584
greater than `_MAX_MULTIPART_SIZE` bytes.
25842585
25852586
It can be obtained by running
2586-
2587+
25872588
`gcloud storage hash /path/to/your/file`
25882589
25892590
or
@@ -2604,7 +2605,7 @@ def _do_upload(
26042605
26052606
Above code block prints 8 char string of base64 encoded big-endian
26062607
bytes of 32 bit CRC32c integer.
2607-
2608+
26082609
More details on CRC32c can be found in Appendix B:
26092610
https://datatracker.ietf.org/doc/html/rfc4960#appendix-B and
26102611
base64: https://datatracker.ietf.org/doc/html/rfc4648#section-4
@@ -2795,12 +2796,12 @@ def _prep_and_do_upload(
27952796
unless otherwise directed.
27962797
27972798
:type crc32c_checksum_value: str
2798-
:param crc32c_checksum_value: (Optional) This should be the checksum of
2799+
:param crc32c_checksum_value: (Optional) This should be the checksum of
27992800
the entire contents of `file_obj`. Applicable while uploading object
28002801
greater than `_MAX_MULTIPART_SIZE` bytes.
28012802
28022803
It can be obtained by running
2803-
2804+
28042805
`gcloud storage hash /path/to/your/file`
28052806
28062807
or
@@ -2821,7 +2822,7 @@ def _prep_and_do_upload(
28212822
28222823
Above code block prints 8 char string of base64 encoded big-endian
28232824
bytes of 32 bit CRC32c integer.
2824-
2825+
28252826
More details on CRC32c can be found in Appendix B:
28262827
https://datatracker.ietf.org/doc/html/rfc4960#appendix-B and
28272828
base64: https://datatracker.ietf.org/doc/html/rfc4648#section-4
@@ -2978,12 +2979,12 @@ def upload_from_file(
29782979
to configure them.
29792980
29802981
:type crc32c_checksum_value: str
2981-
:param crc32c_checksum_value: (Optional) This should be the checksum of
2982+
:param crc32c_checksum_value: (Optional) This should be the checksum of
29822983
the entire contents of `file_obj`. Applicable while uploading object
29832984
greater than `_MAX_MULTIPART_SIZE` bytes.
29842985
29852986
It can be obtained by running
2986-
2987+
29872988
`gcloud storage hash /path/to/your/file`
29882989
29892990
or
@@ -3004,7 +3005,7 @@ def upload_from_file(
30043005
30053006
Above code block prints 8 char string of base64 encoded big-endian
30063007
bytes of 32 bit CRC32c integer.
3007-
3008+
30083009
More details on CRC32c can be found in Appendix B:
30093010
https://datatracker.ietf.org/doc/html/rfc4960#appendix-B and
30103011
base64: https://datatracker.ietf.org/doc/html/rfc4648#section-4
@@ -3068,7 +3069,6 @@ def upload_from_filename(
30683069
checksum="auto",
30693070
retry=DEFAULT_RETRY,
30703071
crc32c_checksum_value=None,
3071-
30723072
):
30733073
"""Upload this blob's contents from the content of a named file.
30743074
@@ -3163,14 +3163,14 @@ def upload_from_filename(
31633163
See the retry.py source code and docstrings in this package
31643164
(google.cloud.storage.retry) for information on retry types and how
31653165
to configure them.
3166-
3166+
31673167
:type crc32c_checksum_value: str
3168-
:param crc32c_checksum_value: (Optional) This should be the checksum of
3168+
:param crc32c_checksum_value: (Optional) This should be the checksum of
31693169
the entire contents of `filename`. Applicable while uploading object
31703170
greater than `_MAX_MULTIPART_SIZE` bytes.
31713171
31723172
It can be obtained by running
3173-
3173+
31743174
`gcloud storage hash /path/to/your/file`
31753175
31763176
or
@@ -3191,7 +3191,7 @@ def upload_from_filename(
31913191
31923192
Above code block prints 8 char string of base64 encoded big-endian
31933193
bytes of 32 bit CRC32c integer.
3194-
3194+
31953195
More details on CRC32c can be found in Appendix B:
31963196
https://datatracker.ietf.org/doc/html/rfc4960#appendix-B and
31973197
base64: https://datatracker.ietf.org/doc/html/rfc4648#section-4
@@ -3314,12 +3314,12 @@ def upload_from_string(
33143314
to configure them.
33153315
33163316
:type crc32c_checksum_value: str
3317-
:param crc32c_checksum_value: (Optional) This should be the checksum of
3317+
:param crc32c_checksum_value: (Optional) This should be the checksum of
33183318
the entire contents of `file_obj`. Applicable while uploading object
33193319
greater than `_MAX_MULTIPART_SIZE` bytes.
33203320
33213321
It can be obtained by running
3322-
3322+
33233323
`gcloud storage hash /path/to/your/file`
33243324
33253325
or
@@ -3340,7 +3340,7 @@ def upload_from_string(
33403340
33413341
Above code block prints 8 char string of base64 encoded big-endian
33423342
bytes of 32 bit CRC32c integer.
3343-
3343+
33443344
More details on CRC32c can be found in Appendix B:
33453345
https://datatracker.ietf.org/doc/html/rfc4960#appendix-B and
33463346
base64: https://datatracker.ietf.org/doc/html/rfc4648#section-4

google/cloud/storage/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
__version__ = "3.4.0"
15+
__version__ = "3.4.1"

tests/system/test_blob.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,11 @@ def test_large_file_write_from_stream_w_user_provided_wrong_checksum(
6262
info = file_data["big_9MiB"]
6363
with pytest.raises(exceptions.BadRequest) as excep_info:
6464
with open(info["path"], "rb") as file_obj:
65-
blob.upload_from_file(file_obj,crc32c_checksum_value="A0tD7w==")
65+
blob.upload_from_file(file_obj, crc32c_checksum_value="A0tD7w==")
6666
blobs_to_delete.append(blob)
6767
assert excep_info.value.code == 400
6868

69+
6970
def test_touch_and_write_large_file_w_user_provided_checksum(
7071
shared_bucket,
7172
blobs_to_delete,

tests/unit/asyncio/test_async_read_object_stream.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,17 @@ async def test_recv_without_open_should_raise_error(
275275
# assert
276276
assert str(exc.value) == "Stream is not open"
277277

278-
@mock.patch("google.cloud.storage._experimental.asyncio.async_read_object_stream.AsyncBidiRpc")
279-
@mock.patch("google.cloud.storage._experimental.asyncio.async_grpc_client.AsyncGrpcClient.grpc_client")
278+
279+
@mock.patch(
280+
"google.cloud.storage._experimental.asyncio.async_read_object_stream.AsyncBidiRpc"
281+
)
282+
@mock.patch(
283+
"google.cloud.storage._experimental.asyncio.async_grpc_client.AsyncGrpcClient.grpc_client"
284+
)
280285
@pytest.mark.asyncio
281-
async def test_recv_updates_read_handle_on_refresh(mock_client, mock_cls_async_bidi_rpc):
286+
async def test_recv_updates_read_handle_on_refresh(
287+
mock_client, mock_cls_async_bidi_rpc
288+
):
282289
"""
283290
Verify that the `recv` method correctly updates the stream's handle
284291
when a new one is provided in a server response.
@@ -289,11 +296,15 @@ async def test_recv_updates_read_handle_on_refresh(mock_client, mock_cls_async_b
289296
socket_like_rpc.open = AsyncMock()
290297

291298
initial_handle = _storage_v2.BidiReadHandle(handle=b"initial-handle-token")
292-
response_with_initial_handle = _storage_v2.BidiReadObjectResponse(read_handle=initial_handle)
299+
response_with_initial_handle = _storage_v2.BidiReadObjectResponse(
300+
read_handle=initial_handle
301+
)
293302
response_without_handle = _storage_v2.BidiReadObjectResponse(read_handle=None)
294303

295304
refreshed_handle = _storage_v2.BidiReadHandle(handle=b"new-refreshed-handle-token")
296-
response_with_refreshed_handle = _storage_v2.BidiReadObjectResponse(read_handle=refreshed_handle)
305+
response_with_refreshed_handle = _storage_v2.BidiReadObjectResponse(
306+
read_handle=refreshed_handle
307+
)
297308

298309
socket_like_rpc.recv.side_effect = [
299310
response_with_initial_handle,

tests/unit/test_blob.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3572,7 +3572,7 @@ def _do_upload_mock_call_helper(
35723572
kwargs,
35733573
{
35743574
"timeout": expected_timeout,
3575-
'crc32c_checksum_value': None,
3575+
"crc32c_checksum_value": None,
35763576
"checksum": None,
35773577
"retry": retry,
35783578
"command": None,

0 commit comments

Comments
 (0)