Skip to content

[Buckets] Add search param to list_buckets#4130

Merged
Wauplin merged 3 commits intomainfrom
add-search-param-to-list-buckets
Apr 22, 2026
Merged

[Buckets] Add search param to list_buckets#4130
Wauplin merged 3 commits intomainfrom
add-search-param-to-list-buckets

Conversation

@alexpouliquen
Copy link
Copy Markdown
Contributor

@alexpouliquen alexpouliquen commented Apr 21, 2026

Add support for buckets list search params.

100% vibecoded, but should be fine


Note

Low Risk
Small, additive change that only affects bucket-listing queries and CLI flag parsing; main risk is behavior differences in list results when --search/search is used.

Overview
Adds a search filter for bucket listing in both Python and CLI.

HfApi.list_buckets(..., search=...) now forwards a search query param to the Hub, and hf buckets list --search ... exposes it with validation to reject use when listing files plus an updated empty-results message. Documentation and CLI reference are updated and new CLI tests cover the flag and error cases.

Reviewed by Cursor Bugbot for commit a647a9b. Bugbot is set up for automated code reviews on this repo. Configure here.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 79ffc3a. Configure here.

Comment thread src/huggingface_hub/cli/buckets.py
Copy link
Copy Markdown
Member

@julien-c julien-c left a comment

Choose a reason for hiding this comment

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

nice 👍

@bot-ci-comment
Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@Pierrci
Copy link
Copy Markdown
Member

Pierrci commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

@Wauplin Wauplin left a comment

Choose a reason for hiding this comment

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

Thanks @alexpouliquen for your PR!

Left a comment regarding tests in the Python library. It's not a list of hard rules but more a set of guidelines we try to follow. These should be in the AGENTS.md but often gets ignored so good to double-check. Other than that, ready to merge!

Comment thread tests/test_buckets_cli.py Outdated
Copy link
Copy Markdown
Contributor

@Wauplin Wauplin left a comment

Choose a reason for hiding this comment

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

Good to merge! First of many? 🎉

@Wauplin Wauplin merged commit 50013bd into main Apr 22, 2026
19 of 21 checks passed
@Wauplin Wauplin deleted the add-search-param-to-list-buckets branch April 22, 2026 15:44
@huggingface-hub-bot
Copy link
Copy Markdown
Contributor

This PR has been shipped as part of the v1.12.0 release.

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.

4 participants