Skip to content
New issue

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

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

Already on GitHub? # to your account

Add "create_branch" and "delete_branch" endpoints #1181

Merged
merged 1 commit into from
Nov 14, 2022

Conversation

Wauplin
Copy link
Contributor

@Wauplin Wauplin commented Nov 10, 2022

Resolve #1165. Follow moon-landing implementation https://github.com/huggingface/moon-landing/pull/4395 (internal link)

This PR adds create_branch and delete_branch methods to HfApi client.


@severo: It is not documented since only available for HF users but I was able to create the /refs/convert/parquet branch with it:

from huggingface_hub import create_branch, create_repo

repo_id = "Wauplin/tmp_to_delete_branch_creation"

create_repo(repo_id)
create_branch(repo_id, branch="refs/convert/parquet")

=> https://huggingface.co/Wauplin/tmp_to_delete_branch_creation/tree/refs%2Fconvert%2Fparquet

@HuggingFaceDocBuilder
Copy link

HuggingFaceDocBuilder commented Nov 10, 2022

The documentation is not available anymore as the PR was closed or merged.

@Wauplin Wauplin added this to the v0.11 milestone Nov 10, 2022
@codecov
Copy link

codecov bot commented Nov 10, 2022

Codecov Report

Base: 83.93% // Head: 84.01% // Increases project coverage by +0.07% 🎉

Coverage data is based on head (e0149ef) compared to base (7e10549).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1181      +/-   ##
==========================================
+ Coverage   83.93%   84.01%   +0.07%     
==========================================
  Files          43       43              
  Lines        4282     4303      +21     
==========================================
+ Hits         3594     3615      +21     
  Misses        688      688              
Impacted Files Coverage Δ
src/huggingface_hub/hf_api.py 88.41% <100.00%> (+0.31%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Wauplin Wauplin merged commit 337351d into main Nov 14, 2022
@Wauplin Wauplin deleted the 1165-add-create-branch-endpoint branch November 14, 2022 10:52
Copy link
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 one! 🎉

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add create_branch and delete_branch http-endpoints
4 participants