Overwrite legacy default config name in `dataset_infos.json` in packaged datasets
NONE
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_6231). All of your documentation changes will be reflected on that endpoint.
2023-09-11T16:33:03Z
https://github.com/huggingface/datasets/pull/6231#issuecomment-1714222817
https://api.github.com/repos/huggingface/datasets/issues/6231
IC_kwDODunzps5mLPbh
https://api.github.com/repos/huggingface/datasets/issues/comments/1714222817/reactions
2023-09-11T16:33:03Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1714222817
https://avatars.githubusercontent.com/u/99929124?v=4
https://api.github.com/users/HuggingFaceDocBuilderDev/events{/privacy}
https://api.github.com/users/HuggingFaceDocBuilderDev/followers
https://api.github.com/users/HuggingFaceDocBuilderDev/following{/other_user}
https://api.github.com/users/HuggingFaceDocBuilderDev/gists{/gist_id}
https://github.com/HuggingFaceDocBuilderDev
HuggingFaceDocBuilderDev
U_kgDOBfTMJA
https://api.github.com/users/HuggingFaceDocBuilderDev/orgs
https://api.github.com/users/HuggingFaceDocBuilderDev/received_events
https://api.github.com/users/HuggingFaceDocBuilderDev/repos
https://api.github.com/users/HuggingFaceDocBuilderDev/starred{/owner}{/repo}
https://api.github.com/users/HuggingFaceDocBuilderDev/subscriptions
User
https://api.github.com/users/HuggingFaceDocBuilderDev
public
CONTRIBUTOR
realized that this pr is still not merged, @lhoestq maybe you can take a look at it? 
2023-09-25T11:08:13Z
https://github.com/huggingface/datasets/pull/6231#issuecomment-1733449629
https://api.github.com/repos/huggingface/datasets/issues/6231
IC_kwDODunzps5nUled
https://api.github.com/repos/huggingface/datasets/issues/comments/1733449629/reactions
2023-09-25T11:08:13Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1733449629
https://avatars.githubusercontent.com/u/16348744?v=4
https://api.github.com/users/polinaeterna/events{/privacy}
https://api.github.com/users/polinaeterna/followers
https://api.github.com/users/polinaeterna/following{/other_user}
https://api.github.com/users/polinaeterna/gists{/gist_id}
https://github.com/polinaeterna
polinaeterna
MDQ6VXNlcjE2MzQ4NzQ0
https://api.github.com/users/polinaeterna/orgs
https://api.github.com/users/polinaeterna/received_events
https://api.github.com/users/polinaeterna/repos
https://api.github.com/users/polinaeterna/starred{/owner}{/repo}
https://api.github.com/users/polinaeterna/subscriptions
User
https://api.github.com/users/polinaeterna
public
MEMBER
I think https://github.com/huggingface/datasets/pull/6218 fixed the issue (a bit differently though)
2023-09-25T12:21:57Z
https://github.com/huggingface/datasets/pull/6231#issuecomment-1733601172
https://api.github.com/repos/huggingface/datasets/issues/6231
IC_kwDODunzps5nVKeU
https://api.github.com/repos/huggingface/datasets/issues/comments/1733601172/reactions
2023-09-25T12:21:57Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1733601172
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
MEMBER
ah actually nope, let me check
2023-09-25T12:22:49Z
https://github.com/huggingface/datasets/pull/6231#issuecomment-1733603570
https://api.github.com/repos/huggingface/datasets/issues/6231
IC_kwDODunzps5nVLDy
https://api.github.com/repos/huggingface/datasets/issues/comments/1733603570/reactions
2023-09-25T12:22:49Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1733603570
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
CONTRIBUTOR
@lhoestq yeah the pr you're referencing doesn't fix the problem when two semantically analogous configs occur in datasets_info.json, i suggest to rewrite the legacy one if it exists during .push_to_hub
2023-09-25T12:26:04Z
https://github.com/huggingface/datasets/pull/6231#issuecomment-1733610892
https://api.github.com/repos/huggingface/datasets/issues/6231
IC_kwDODunzps5nVM2M
https://api.github.com/repos/huggingface/datasets/issues/comments/1733610892/reactions
2023-09-25T12:26:04Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1733610892
https://avatars.githubusercontent.com/u/16348744?v=4
https://api.github.com/users/polinaeterna/events{/privacy}
https://api.github.com/users/polinaeterna/followers
https://api.github.com/users/polinaeterna/following{/other_user}
https://api.github.com/users/polinaeterna/gists{/gist_id}
https://github.com/polinaeterna
polinaeterna
MDQ6VXNlcjE2MzQ4NzQ0
https://api.github.com/users/polinaeterna/orgs
https://api.github.com/users/polinaeterna/received_events
https://api.github.com/users/polinaeterna/repos
https://api.github.com/users/polinaeterna/starred{/owner}{/repo}
https://api.github.com/users/polinaeterna/subscriptions
User
https://api.github.com/users/polinaeterna
public
MEMBER
Only the old versions of `datasets` use the JSON file over the README and they can only load one config so the name doesn't really matter.

That's why I chose to load the info from the JSON no matter the name (no check to see if it's "username--dataset_name") in my previous PR.

I think you can remove the old info without even checking the name. In this case maybe no need to update load.py 
2023-09-25T12:41:40Z
https://github.com/huggingface/datasets/pull/6231#issuecomment-1733635058
https://api.github.com/repos/huggingface/datasets/issues/6231
IC_kwDODunzps5nVSvy
https://api.github.com/repos/huggingface/datasets/issues/comments/1733635058/reactions
2023-09-25T12:41:40Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1733635058
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
MEMBER
(also minor: not checking the name makes it more robust to dataset renaming)
2023-09-25T12:44:23Z
https://github.com/huggingface/datasets/pull/6231#issuecomment-1733639183
https://api.github.com/repos/huggingface/datasets/issues/6231
IC_kwDODunzps5nVTwP
https://api.github.com/repos/huggingface/datasets/issues/comments/1733639183/reactions
2023-09-25T12:44:23Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1733639183
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
CONTRIBUTOR
@lhoestq okay makes sense... so you think it's not a problem that in some cases we might end up with `dataset_infos.json` having two keys in it?
2023-09-25T13:25:04Z
https://github.com/huggingface/datasets/pull/6231#issuecomment-1733708180
https://api.github.com/repos/huggingface/datasets/issues/6231
IC_kwDODunzps5nVkmU
https://api.github.com/repos/huggingface/datasets/issues/comments/1733708180/reactions
2023-09-25T13:25:04Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1733708180
https://avatars.githubusercontent.com/u/16348744?v=4
https://api.github.com/users/polinaeterna/events{/privacy}
https://api.github.com/users/polinaeterna/followers
https://api.github.com/users/polinaeterna/following{/other_user}
https://api.github.com/users/polinaeterna/gists{/gist_id}
https://github.com/polinaeterna
polinaeterna
MDQ6VXNlcjE2MzQ4NzQ0
https://api.github.com/users/polinaeterna/orgs
https://api.github.com/users/polinaeterna/received_events
https://api.github.com/users/polinaeterna/repos
https://api.github.com/users/polinaeterna/starred{/owner}{/repo}
https://api.github.com/users/polinaeterna/subscriptions
User
https://api.github.com/users/polinaeterna
public
MEMBER
> @lhoestq okay makes sense... so you think it's not a problem that in some cases we might end up with dataset_infos.json having two keys in it?

Ideally they should have only one config no ? Since old versions of `datasets` simply load the first config in the JSON.
We can overwrite it with the new default one (and no matter the name of the outdated config in the JSON)


2023-09-26T11:19:36Z
https://github.com/huggingface/datasets/pull/6231#issuecomment-1735334543
https://api.github.com/repos/huggingface/datasets/issues/6231
IC_kwDODunzps5nbxqP
https://api.github.com/repos/huggingface/datasets/issues/comments/1735334543/reactions
2023-09-26T11:19:36Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1735334543
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
Currently if we push data as default config with `.push_to_hub` to a repo that has a legacy `dataset_infos.json` file containing a legacy default config name like `{username}--{dataset_name}`, new key `"default"` is added to `dataset_infos.json` along with the legacy one. I think the legacy one should be dropped in this case.

Also, in `load.py` I suggest to check if a legacy config name is indeed a legacy config name because after this fix it might not be the case (this check was first introduced in https://github.com/huggingface/datasets/pull/6218)