huggingface / dataset-viewer

Backend that powers the dataset viewer on Hugging Face dataset pages through a public API.
https://huggingface.co/docs/dataset-viewer
Apache License 2.0
698 stars 77 forks source link

Simplify test code where a dataset is set as gated #3063

Open severo opened 2 months ago

severo commented 2 months ago

huggingface_hub@0.25.0 provides an API to set a repository as gated.

We had included a custom version of update_repo_settings because it lacked a gated parameter. Now we can switch back to the huggingface_hub method

https://github.com/huggingface/dataset-viewer/blob/4859100ef282dcf73257dfb60e6b5a20d5955c68/jobs/cache_maintenance/tests/utils.py#L41 https://github.com/huggingface/dataset-viewer/blob/4859100ef282dcf73257dfb60e6b5a20d5955c68/services/admin/tests/fixtures/hub.py#L24 https://github.com/huggingface/dataset-viewer/blob/4859100ef282dcf73257dfb60e6b5a20d5955c68/services/worker/tests/fixtures/hub.py#L35

severo commented 2 months ago

depends on https://github.com/huggingface/dataset-viewer/issues/3064