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

HfApi.create_repo fails in 0.5 if the org name is passed in repo_id and organization arguments #821

Closed
lhoestq opened this issue Apr 6, 2022 · 1 comment · Fixed by #822
Assignees
Labels
bug Something isn't working

Comments

@lhoestq
Copy link
Member

lhoestq commented Apr 6, 2022

As reported in huggingface/datasets#4105 if you pass a repo_id (containing the org name or not), and also the organization parameter to HfApi.create_repo, then you get this error:

~/.virtualenvs/hf-datasets/lib/python3.7/site-packages/huggingface_hub/utils/_deprecation.py in inner_f(*args, **kwargs)
     44             )
     45             kwargs.update(zip(sig.parameters, args))
---> 46             return f(**kwargs)
     47 
     48         return inner_f

~/.virtualenvs/hf-datasets/lib/python3.7/site-packages/huggingface_hub/hf_api.py in create_repo(self, repo_id, token, organization, private, repo_type, exist_ok, space_sdk, name)
   1260         - [1] https://huggingface.co/settings/tokens
   1261         """
-> 1262         name, organization = _validate_repo_id_deprecation(repo_id, name, organization)
   1263 
   1264         path = f"{self.endpoint}/api/repos/create"

~/.virtualenvs/hf-datasets/lib/python3.7/site-packages/huggingface_hub/hf_api.py in _validate_repo_id_deprecation(repo_id, name, organization)
     66     if repo_id and (name or organization):
     67         raise ValueError(
---> 68             "Only pass `repo_id` and leave deprecated `name` and "
     69             "`organization` to be None."
     70         )

ValueError: Only pass `repo_id` and leave deprecated `name` and `organization` to be None.

This used to be allowed in 0.4 and is a breaking change that makes push_to_hub fail for all versions of datasets.

As a general rule, deprecations should also log warnings rather than fail.

@lhoestq lhoestq self-assigned this Apr 6, 2022
@lhoestq lhoestq added the bug Something isn't working label Apr 6, 2022
@adrinjalali
Copy link
Contributor

PR with the hotfix: #822

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants