Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paginate followers and following endpoints #2506

Merged
merged 2 commits into from
Sep 4, 2024
Merged

Conversation

Wauplin
Copy link
Contributor

@Wauplin Wauplin commented Sep 4, 2024

Follow-up after #2147

Just noticed we were missing a few things:

  • results in list_organization_members, list_user_followers and list_user_following must be paginated for profiles like https://huggingface.co/clem with more than 500 followers and following
  • these endpoints didn't have a token parameter (better to have it for consistency)
  • they were not exposed at the root of the package

This PR fixes all of this. I've updated the tests to check pagination works as expected.

(I also updated utils/check_static_imports.py script to avoid duplicates in the __init__.py)

@Wauplin Wauplin requested a review from LysandreJik September 4, 2024 07:20
@HuggingFaceDocBuilderDev

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.

Copy link
Contributor

@hanouticelina hanouticelina left a comment

Choose a reason for hiding this comment

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

thanks @Wauplin, looks good to me 👍 among other endpoints, there is also results fromlist_repo_likers that can reach 5k users returned. This can also be paginated

@Wauplin
Copy link
Contributor Author

Wauplin commented Sep 4, 2024

Thanks for noticing! I'll merge this PR but I created an issue for list_repo_likers #2508

@Wauplin Wauplin merged commit bec8b99 into main Sep 4, 2024
19 checks passed
@Wauplin Wauplin deleted the paginate-followers branch September 4, 2024 09:36
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.

3 participants