GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: add system test for opening with read_handle by chandra-siri · Pull Request #1672 · googleapis/python-storage

This repository was archived by the owner on Mar 31, 2026. It is now read-only.

Conversation

@chandra-siri

@chandra-siri chandra-siri commented Dec 17, 2025

Copy link
Copy Markdown
Collaborator

fix: add system test for opening with read_handle

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
chandra-siri added 5 commits December 17, 2025 13:21
@chandra-siri
feat: expose persisted size in mrd
42fad51
@chandra-siri
initialize "persisted_size" to None
aff6c57
@chandra-siri
add system test for mrd persisted size
fbe88eb
@chandra-siri
add keys env variable
e181f4d
@chandra-siri
fix: add system test for opening with read_handle
880787f
@product-auto-label product-auto-label Bot added size: m Pull request size is medium. api: storage Issues related to the googleapis/python-storage API. labels Dec 17, 2025
@gemini-code-assist

gemini-code-assist Bot commented Dec 17, 2025

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @chandra-siri, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request primarily focuses on enhancing the testing coverage for asynchronous object reading functionalities, particularly when dealing with read_handles. It introduces new system and unit tests to ensure that objects can be reliably opened and downloaded using a read_handle, which is crucial for resuming downloads or sharing read states. Minor code adjustments were made to support these tests and improve the robustness of stream handling.

Highlights

  • System Test for read_handle: Introduced a new system test (test_mrd_open_with_read_handle) to validate the functionality of opening an AsyncMultiRangeDownloader using a read_handle. This test ensures that an object can be downloaded correctly after being opened with a previously obtained handle.
  • Unit Test for read_handle: Added a unit test (test_open_with_read_handle) for _AsyncReadObjectStream to specifically verify its behavior when initialized and opened with a read_handle, including checks for generation_number and persisted_size.
  • _AsyncReadObjectStream Initialization Refinement: The initialization of first_bidi_read_req in _AsyncReadObjectStream has been moved from __init__ to the open method, allowing the read_handle to be dynamically included in the request.
  • Robust Metadata Access: Improved the robustness of metadata access in _AsyncReadObjectStream.open() by adding a hasattr check before accessing response.metadata, preventing potential attribute errors.
  • Resource Cleanup: Added self.read_obj_str = None in AsyncMultiRangeDownloader.close() to explicitly clear the reference to the underlying stream, aiding in resource management.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gemini-code-assist[bot]
gemini-code-assist Bot reviewed Dec 17, 2025
View reviewed changes

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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.

Code Review

This pull request adds a system test for opening a multi-range downloader with a read_handle, which is a good addition for ensuring the feature's correctness. The related code changes in _AsyncReadObjectStream to support this functionality are logical and well-implemented. My review includes one high-severity suggestion for the new test fixture in tests/system/test_zonal.py to use async def and await, which aligns with pytest-asyncio best practices and prevents potential event loop conflicts.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread tests/system/test_zonal.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@chandra-siri

chandra-siri commented Dec 17, 2025

Copy link
Copy Markdown
Collaborator Author

/gcbrun

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chandra-siri

chandra-siri commented Dec 17, 2025

Copy link
Copy Markdown
Collaborator Author

/gcbrun(880787f)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chandra-siri
chandra-siri marked this pull request as ready for review December 17, 2025 16:27
@chandra-siri
chandra-siri requested review from a team December 17, 2025 16:27
@chandra-siri
chandra-siri requested a review from a team as a code owner December 17, 2025 16:27
@chandra-siri
always instantitate new read_obj_stream while opening
efc636c
Base automatically changed from feat_expose_size to main December 18, 2025 03:58
chandra-siri added 3 commits December 18, 2025 04:26
@chandra-siri
fix: add system test for opening with read_handle
e0f8318
@chandra-siri
always instantitate new read_obj_stream while opening
a78ab32
@chandra-siri
Merge branch 'sys_test_1' of github.com:googleapis/python-storage int…
7aa5fbc
…o sys_test_1
@chandra-siri chandra-siri assigned suni72 Dec 18, 2025
suni72
suni72 approved these changes Dec 18, 2025
View reviewed changes
@suni72

suni72 commented Dec 18, 2025

Copy link
Copy Markdown

Please fix failing checks

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chandra-siri

chandra-siri commented Dec 18, 2025

Copy link
Copy Markdown
Collaborator Author

Please fix failing checks

Samples - Python 3.14 is blocked , others passed.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chandra-siri
chandra-siri merged commit 6dc711d into main Dec 18, 2025
@chandra-siri
chandra-siri deleted the sys_test_1 branch December 18, 2025 11:24
@release-please release-please Bot mentioned this pull request Dec 18, 2025
chore(main): release 3.8.0 #1669
Closed
@vchudnov-g vchudnov-g mentioned this pull request Jan 12, 2026
chore: librarian release pull request: 20260112T135255Z #1701
Closed
@parthea parthea mentioned this pull request Jan 13, 2026
chore: librarian release pull request: 20260113T144551Z #1704
Merged
vchudnov-g added a commit that referenced this pull request Jan 13, 2026
@parthea @vchudnov-g
chore: librarian release pull request: 20260113T144551Z (#1704)
16cf512
PR created by the Librarian CLI to initialize a release. Merging this PR
will auto trigger a release.

Librarian Version: v0.7.0
Language Image:
us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator@sha256:8e2c32496077054105bd06c54a59d6a6694287bc053588e24debe6da6920ad91
<details><summary>google-cloud-storage: 3.8.0</summary>

##
[3.8.0](v3.7.0...v3.8.0)
(2026-01-13)

### Features

* expose persisted size in mrd (#1671)
([0e2961b](0e2961be))

* implement &#34;append_from_file&#34; (#1686)
([1333c95](1333c956))

* compute chunk wise checksum for bidi_writes (#1675)
([139390c](139390cb))

* flush the last chunk in append method (#1699)
([89bfe7a](89bfe7a5))

* add write resumption strategy (#1663)
([a57ea0e](a57ea0ec))

* add bidi stream retry manager. (#1632)
([d90f0ee](d90f0ee0))

* make flush size configurable (#1677)
([f7095fa](f7095faf))

### Bug Fixes

* no state lookup while opening bidi-write stream
([2d5a7b1](2d5a7b16))

* no state lookup while opening bidi-write stream (#1636)
([2d5a7b1](2d5a7b16))

* close write object stream always (#1661)
([4a609a4](4a609a4b))

* add system test for opening with read_handle (#1672)
([6dc711d](6dc711da))

</details>

---------

Co-authored-by: Victor Chudnovsky <[email protected]>
@release-please release-please Bot mentioned this pull request Jan 13, 2026
chore(main): release 3.8.0 #1706
Closed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

2 more reviewers
@gemini-code-assist gemini-code-assist[bot] gemini-code-assist[bot] left review comments
@suni72 suni72 suni72 approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@suni72 suni72

Labels

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

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@chandra-siri @suni72
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.