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

Align signature of create/delete_repo with latest hfh #5064

Merged
merged 4 commits into from
Oct 7, 2022

Conversation

albertvillanova
Copy link
Member

This PR aligns the signature of create_repo/delete_repo with the current one in hfh, by removing deprecated name and organization, and using repo_id instead.

Related to:

CC: @lhoestq

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Oct 4, 2022

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

Copy link
Member

@lhoestq lhoestq left a comment

Choose a reason for hiding this comment

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

small bug:

src/datasets/utils/_hf_hub_fixes.py Outdated Show resolved Hide resolved
return hf_api.create_repo(
name=name,
organization=organization,
organization=organization or None,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
organization=organization or None,
organization=organization,

@@ -88,15 +83,16 @@ def delete_repo(
`str`: URL to the newly created repo.
"""
if version.parse(huggingface_hub.__version__) < version.parse("0.5.0"):
name, *organization = repo_id.split("/")
Copy link
Member

Choose a reason for hiding this comment

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

same here

Suggested change
name, *organization = repo_id.split("/")
organization, name = repo_id.split("/") if "/" in repo_id else None, repo_id

src/datasets/utils/_hf_hub_fixes.py Outdated Show resolved Hide resolved
@albertvillanova albertvillanova merged commit 0417fd5 into huggingface:main Oct 7, 2022
@albertvillanova albertvillanova deleted the align-hfh-repo_id branch October 7, 2022 16:59
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