Skip to content

feat(storagecontrol): add delete folder recursive sample#14382

Draft
nidhiii-27 wants to merge 2 commits into
mainfrom
feat/add-python-delete-folder-recursive
Draft

feat(storagecontrol): add delete folder recursive sample#14382
nidhiii-27 wants to merge 2 commits into
mainfrom
feat/add-python-delete-folder-recursive

Conversation

@nidhiii-27

Copy link
Copy Markdown
Contributor

Adds a Python code sample demonstrating hierarchical namespace recursive folder delete.

Fixes: b/530058898

Adds a Python code sample demonstrating hierarchical namespace recursive folder delete.

Fixes: b/530058898

[Generated-by: AI]
@product-auto-label product-auto-label Bot added the samples Issues that are directly related to samples. label Jul 6, 2026

@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 a new script delete_folder_recursive.py to recursively delete folders in Google Cloud Storage using the Storage Control API, along with corresponding integration tests in snippets_test.py. Feedback is provided regarding an incorrect type hint for the capsys fixture in the test file, which should be typed as pytest.CaptureFixture[str] instead of pytest.LogCaptureFixture.



def test_delete_folder_recursive(
capsys: pytest.LogCaptureFixture, hns_enabled_bucket: storage.Bucket, uuid_name: str

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.

medium

The capsys fixture in pytest is of type pytest.CaptureFixture[str], not pytest.LogCaptureFixture (which is used for caplog). Using the correct type hint avoids static analysis/type-checking warnings.

Suggested change
capsys: pytest.LogCaptureFixture, hns_enabled_bucket: storage.Bucket, uuid_name: str
capsys: pytest.CaptureFixture[str], hns_enabled_bucket: storage.Bucket, uuid_name: str

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

Labels

ai-generated samples Issues that are directly related to samples. storage-sample-architect

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant