Skip to content

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

Merged
nidhiii-27 merged 7 commits into
mainfrom
feat/add-python-delete-folder-recursive
Sep 7, 2026
Merged

feat(storagecontrol): add delete folder recursive sample#14382
nidhiii-27 merged 7 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.

Comment thread storagecontrol/snippets_test.py Outdated


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

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.

Done

Co-authored by AI Agent

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.

Done

Co-authored by AI Agent

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.

Done

Co-authored by AI Agent

@nidhiii-27
nidhiii-27 marked this pull request as ready for review September 7, 2026 17:01
@nidhiii-27
nidhiii-27 requested review from a team as code owners September 7, 2026 17:01
@snippet-bot

snippet-bot Bot commented Sep 7, 2026

Copy link
Copy Markdown

Here is the summary of changes.

You are about to add 1 region tag.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@nidhiii-27
nidhiii-27 merged commit 4c17e58 into main Sep 7, 2026
14 of 22 checks passed
@nidhiii-27
nidhiii-27 deleted the feat/add-python-delete-folder-recursive branch September 7, 2026 17:01
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.

2 participants