Skip to content

samples(storagecontrol): add delete folder recursive sample#14299

Open
nidhiii-27 wants to merge 1 commit into
mainfrom
add-delete-folder-recursive-sample
Open

samples(storagecontrol): add delete folder recursive sample#14299
nidhiii-27 wants to merge 1 commit into
mainfrom
add-delete-folder-recursive-sample

Conversation

@nidhiii-27

Copy link
Copy Markdown
Contributor

This PR adds the SDK sample and tests for the hierarchical namespace recursive delete feature, resolving b/521168740.

@nidhiii-27 nidhiii-27 requested review from a team as code owners June 10, 2026 09:12
@snippet-bot

snippet-bot Bot commented Jun 10, 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

@product-auto-label product-auto-label Bot added the samples Issues that are directly related to samples. label Jun 10, 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, along with its corresponding test file, delete_folder_recursive_test.py, to recursively delete folders in Google Cloud Storage. The feedback points out an incorrect type hint for the capsys fixture in the test file, which should be corrected from pytest.LogCaptureFixture to pytest.CaptureFixture[str] to prevent static analysis and type-checking errors.

Comment on lines +23 to +25
def test_delete_folder_recursive(
capsys: pytest.LogCaptureFixture, hns_enabled_bucket: storage.Bucket, uuid_name: str
) -> None:

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], whereas pytest.LogCaptureFixture is used for the caplog fixture. Using the incorrect type hint can cause static analysis and type-checking tools like mypy to report errors.

Suggested change
def test_delete_folder_recursive(
capsys: pytest.LogCaptureFixture, hns_enabled_bucket: storage.Bucket, uuid_name: str
) -> None:
def test_delete_folder_recursive(
capsys: pytest.CaptureFixture[str], hns_enabled_bucket: storage.Bucket, uuid_name: str
) -> None:

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

Labels

samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant