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 — feat(experimental): flush the last chunk in append method by Pulkit0110 · Pull Request #1699 · googleapis/python-storage

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

Conversation

@Pulkit0110

@Pulkit0110 Pulkit0110 commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

Earlier the last chunk was being flushed while calling the close() method. Now it will be done inside the append method itself.

Sorry, something went wrong.

Uh oh!

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

All reactions
@Pulkit0110
feat(experimental): flush the last chunk in append method
2c3cd2f
@Pulkit0110
Pulkit0110 requested review from a team January 8, 2026 09:26
@Pulkit0110
Pulkit0110 requested a review from a team as a code owner January 8, 2026 09:26
@blunderbuss-gcf blunderbuss-gcf Bot assigned chandra-siri Jan 8, 2026
@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 Jan 8, 2026
@gemini-code-assist

gemini-code-assist Bot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @Pulkit0110, 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 refactors the asynchronous object writing mechanism to improve data persistence guarantees. By shifting the responsibility of flushing the final data chunk from the close() method to the append() method, data is now persisted more promptly. This change streamlines the write process, ensures that all data sent via append() is immediately accounted for, and simplifies the overall state management of the object writer.

Highlights

  • Flushing Logic Relocation: The mechanism for flushing the last data chunk has been moved from the close() method directly into the append() method, ensuring immediate persistence of the final segment of data.
  • Enhanced Append Method: The append() method now explicitly sets flush=True and state_lookup=True on the gRPC request for the last chunk of data being sent, providing more granular control over data persistence and state updates.
  • Simplified Close Method: The close() method has been simplified by removing the explicit flush call when finalize_on_close is false, as this responsibility is now handled by the append() method.
  • Stream Management in Finalize: The finalize() method now includes the logic for closing the underlying write stream and resetting the writer's internal state, centralizing stream cleanup when an object is finalized.
  • Comprehensive Test Coverage: New system tests and updated unit tests have been added to thoroughly validate the revised flushing behavior and stream management within the AsyncAppendableObjectWriter.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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 Jan 8, 2026
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 refactors the AsyncAppendableObjectWriter to flush the last chunk of data within the append method itself, rather than waiting for the close method. This change improves the writer's behavior by ensuring data is persisted more promptly. The implementation correctly handles flushing based on both the flush interval and whether a chunk is the last in an append call. The close and finalize methods have been updated to reflect this new behavior, and the stream is now correctly closed within finalize. The accompanying test changes, including a new system test, effectively validate the new logic. I have one suggestion to slightly refactor the flushing logic for improved clarity.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread google/cloud/storage/_experimental/asyncio/async_appendable_object_writer.py Resolved

Uh oh!

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

chandra-siri
chandra-siri suggested changes Jan 8, 2026
View reviewed changes
Comment thread google/cloud/storage/_experimental/asyncio/async_appendable_object_writer.py Resolved

Uh oh!

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

Comment thread google/cloud/storage/_experimental/asyncio/async_appendable_object_writer.py Resolved

Uh oh!

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

Comment thread tests/system/test_zonal.py Resolved

Uh oh!

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

Comment thread tests/unit/asyncio/test_async_appendable_object_writer.py Resolved

Uh oh!

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

Comment thread google/cloud/storage/_experimental/asyncio/async_appendable_object_writer.py Resolved

Uh oh!

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

Comment thread google/cloud/storage/_experimental/asyncio/async_appendable_object_writer.py Resolved

Uh oh!

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

@Pulkit0110
fix system tests and address comments
fcbea03
@Pulkit0110
Pulkit0110 requested a review from chandra-siri January 10, 2026 18:24
chandra-siri
chandra-siri approved these changes Jan 11, 2026
View reviewed changes
Comment thread tests/system/test_zonal.py Resolved

Uh oh!

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

Comment thread tests/system/test_zonal.py Resolved

Uh oh!

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

@chandra-siri
chandra-siri merged commit 89bfe7a into googleapis:main Jan 11, 2026
@release-please release-please Bot mentioned this pull request Jan 2, 2026
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
@chandra-siri chandra-siri chandra-siri approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

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

Assignees

@chandra-siri chandra-siri

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

@Pulkit0110 @chandra-siri
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.