Fix TestCommand to move dataset_infos instead of copying
{'login': 'albertvillanova', 'id': 8515462, 'node_id': 'MDQ6VXNlcjg1MTU0NjI=', 'avatar_url': 'https://avatars.githubusercontent.com/u/8515462?v=4', 'gravatar_id': '', 'url': 'https://api.github.com/users/albertvillanova', 'html_url': 'https://github.com/albertvillanova', 'followers_url': 'https://api.github.com/users/albertvillanova/followers', 'following_url': 'https://api.github.com/users/albertvillanova/following{/other_user}', 'gists_url': 'https://api.github.com/users/albertvillanova/gists{/gist_id}', 'starred_url': 'https://api.github.com/users/albertvillanova/starred{/owner}{/repo}', 'subscriptions_url': 'https://api.github.com/users/albertvillanova/subscriptions', 'organizations_url': 'https://api.github.com/users/albertvillanova/orgs', 'repos_url': 'https://api.github.com/users/albertvillanova/repos', 'events_url': 'https://api.github.com/users/albertvillanova/events{/privacy}', 'received_events_url': 'https://api.github.com/users/albertvillanova/received_events', 'type': 'User', 'site_admin': False}
[]
[]
["All the datasets that are loaded normally with `load_dataset`, if `dataset_infos.json` exists, have this file in the importable directory. So it's fine if we copy the file instead of moving it but it's not a big deal.\r\n\r\nAny reason to prefer moving it rather than copying it ?"
 "@lvwerra reported than when generating the `dataset_infos.json` for multiple dataset directories containing only JSONL files, subsequent `dataset_infos.json` files contained all previous directories as configs:\r\n- First generate metadata for dataset in dir `dir1`: dataset_infos.json contains one config for `dir1`\r\n- Then generate metadata for dataset in dir `dir2`: dataset_infos.json contains 2 configs, for `dir1` and `dir2`\r\n\r\nThe reason is that all dataset_infos.json files are first created in the same dir (the one containing the json builder) and then **copied** to the user dir.\r\n\r\nSubsequent calls of TestCommand don't replace the dataset_infos.json already present in the dir of the json builder, but append to it.\r\n\r\nMAYBE: we should just move for this use case, and copy for the other use cases? See this use case here:\r\n- #3680"
 "@lhoestq aren't you mentioning the case in the else clause?\r\n```python\r\nelse:  # in case of a remote dataset\r\n    dataset_dir = None\r\n```\r\n\r\nIn that case `dataset_infos.json` is not copied: `dataset_dir = None`"
 "When using the JSON loader, calling `get_imported_module_dir()` returns a path inside the pip installed packages, so we shouldn't write files in it anyway, and the dataset_infos.json file should be written directly in the user's directory instead (some users don't have write access to the pip installed packages for example).\r\n\r\nMaybe the packaged modules like `json` should override `_save_infos` to save them in the user's directory instead of next to the builder's script. What do you think ?"
 'Anyway as a hotfix we can just add an exception for the `json` builder for now, if the issue has to be fixed soon']
{'url': 'https://api.github.com/repos/huggingface/datasets/pulls/3681', 'html_url': 'https://github.com/huggingface/datasets/pull/3681', 'diff_url': 'https://github.com/huggingface/datasets/pull/3681.diff', 'patch_url': 'https://github.com/huggingface/datasets/pull/3681.patch', 'merged_at': None}
Why do we copy instead of moving the file?

CC: @lhoestq @lvwerra 
{'url': 'https://api.github.com/repos/huggingface/datasets/issues/3681/reactions', 'total_count': 0, '+1': 0, '-1': 0, 'laugh': 0, 'hooray': 0, 'confused': 0, 'heart': 0, 'rocket': 0, 'eyes': 0}