diff --git a/src/datasets/download/mock_download_manager.py b/src/datasets/download/mock_download_manager.py index 4367a147a8b..a4dd0e2ad22 100644 --- a/src/datasets/download/mock_download_manager.py +++ b/src/datasets/download/mock_download_manager.py @@ -161,8 +161,9 @@ def create_dummy_data_dict(self, path_to_dummy_data, data_url): dummy_data_dict[key] = value # make sure that values are unique - first_value = next(iter(dummy_data_dict.values())) - if isinstance(first_value, str) and len(set(dummy_data_dict.values())) < len(dummy_data_dict.values()): + if all([isinstance(i, str) for i in dummy_data_dict.values()]) and len(set(dummy_data_dict.values())) < len( + dummy_data_dict.values() + ): # append key to value to make its name unique dummy_data_dict = {key: value + key for key, value in dummy_data_dict.items()}