Skip to content

feat(storage): support storage_class in AsyncAppendableObjectWriter - #18289

Open
chandra-siri wants to merge 8 commits into
googleapis:mainfrom
chandra-siri:feat/storage-class-rapid
Open

feat(storage): support storage_class in AsyncAppendableObjectWriter#18289
chandra-siri wants to merge 8 commits into
googleapis:mainfrom
chandra-siri:feat/storage-class-rapid

Conversation

@chandra-siri

@chandra-siri chandra-siri commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Description

Adds support for specifying storage_class when writing appendable objects via AsyncAppendableObjectWriter, and updates system test configuration and zonal tests to support RCU buckets and preprod environments.

Changes

  • Core Library:

    • Added storage_class parameter (defaulting to None) in AsyncAppendableObjectWriter.__init__ and propagated it to _AsyncWriteObjectStream during open().
    • Added storage_class parameter in _AsyncWriteObjectStream.__init__ and set it on the _storage_v2.Object resource when opening the stream.
  • Unit Tests:

    • Added unit tests in test_async_appendable_object_writer.py and test_async_write_object_stream.py covering storage_class initialization and stream opening.
  • System Tests:

    • Added preprod endpoints and RUN_SYSTEM_TESTS_ON_PREPROD fixture support in conftest.py.
    • Added RCU bucket configuration support (RUN_RCU_SYSTEM_TESTS, RCU_BUCKET) alongside zonal bucket tests in test_zonal.py.
    • Updated direct AsyncAppendableObjectWriter instantiations in zonal system tests to pass storage_class="RAPID" if RCU_SYSTEM_TESTS else None and use bucket_for_testing.
    • Added appropriate skipif markers on tests for features not yet supported in SDK under RCU (cross-region, write from blob, KMS, contexts).

@chandra-siri
chandra-siri requested a review from a team as a code owner September 4, 2026 14:37

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

Copy link
Copy Markdown
Contributor

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 introduces support for specifying a storage_class (specifically 'STANDARD' or 'RAPID') when asynchronously writing or appending to GCS objects. The feedback suggests importing the _SUPPORTED_STORAGE_CLASSES constant to avoid duplication, normalizing the storage_class input to uppercase for robustness, and updating the unit tests to verify this case-insensitive behavior.

Add support for specifying storage_class when writing objects via AsyncAppendableObjectWriter.

- Add storage_class parameter to AsyncAppendableObjectWriter.__init__ and
  propagate it to _AsyncWriteObjectStream on open().
- Add storage_class parameter to _AsyncWriteObjectStream.__init__ and pass it
  to _storage_v2.Object creation.
- Add unit tests covering initialization and open stream requests.
@chandra-siri
chandra-siri force-pushed the feat/storage-class-rapid branch from acb948c to e2eab99 Compare September 8, 2026 15:09
RCU_SYSTEM_TESTS = os.getenv("RUN_RCU_SYSTEM_TESTS") == "True"
_RCU_BUCKET = os.getenv("RCU_BUCKET")
bucket_for_testing = (
_ZONAL_BUCKET if os.getenv("RUN_ZONAL_SYSTEM_TESTS") else _RCU_BUCKET

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I can see everywhere else we are explicitly checking True string, is it required here as well?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes, good catch. it should be - _ZONAL_BUCKET if os.getenv("RUN_ZONAL_SYSTEM_TESTS")==True else _RCU_BUCKET

but below is also makes sense and more readable.

_RCU_BUCKET if RCU_SYSTEM_TESTS else _ZONAL_BUCKET

)

async def create_async_grpc_client(attempt_direct_path=True):
async def create_async_grpc_client(attempt_direct_path=True, preprod=False):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

are we exposing preprod testing setup?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes. any concerns ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants