Title: Fix offline mode with single config
State: closed

Reported in https://github.com/huggingface/datasets/issues/4760

The cache was not able to reload a dataset with a single config form the cache if the config name is not specificed

For example

```python
from datasets import load_dataset, config

config.HF_DATASETS_OFFLINE = True

load_dataset("openai_humaneval")
```

This was due to a regression in https://github.com/huggingface/datasets/pull/6632

Comments: The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_6741). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.<details>
<summary>Show benchmarks</summary>

PyArrow==8.0.0

<details>
<summary>Show updated benchmarks!</summary>

### Benchmark: benchmark_array_xd.json

| metric | read_batch_formatted_as_numpy after write_array2d | read_batch_formatted_as_numpy after write_flattened_sequence | read_batch_formatted_as_numpy after write_nested_sequence | read_batch_unformated after write_array2d | read_batch_unformated after write_flattened_sequence | read_batch_unformated after write_nested_sequence | read_col_formatted_as_numpy after write_array2d | read_col_formatted_as_numpy after write_flattened_sequence | read_col_formatted_as_numpy after write_nested_sequence | read_col_unformated after write_array2d | read_col_unformated after write_flattened_sequence | read_col_unformated after write_nested_sequence | read_formatted_as_numpy after write_array2d | read_formatted_as_numpy after write_flattened_sequence | read_formatted_as_numpy after write_nested_sequence | read_unformated after write_array2d | read_unformated after write_flattened_sequence | read_unformated after write_nested_sequence | write_array2d | write_flattened_sequence | write_nested_sequence |
|--------|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| new / old (diff) | 0.005093 / 0.011353 (-0.006260) | 0.003317 / 0.011008 (-0.007692) | 0.064795 / 0.038508 (0.026287) | 0.030373 / 0.023109 (0.007263) | 0.258776 / 0.275898 (-0.017122) | 0.269768 / 0.323480 (-0.053711) | 0.004186 / 0.007986 (-0.003799) | 0.002630 / 0.004328 (-0.001699) | 0.048643 / 0.004250 (0.044392) | 0.044220 / 0.037052 (0.007168) | 0.265113 / 0.258489 (0.006624) | 0.292202 / 0.293841 (-0.001639) | 0.027468 / 0.128546 (-0.101079) | 0.010123 / 0.075646 (-0.065523) | 0.226869 / 0.419271 (-0.192402) | 0.035739 / 0.043533 (-0.007794) | 0.253193 / 0.255139 (-0.001946) | 0.271002 / 0.283200 (-0.012198) | 0.017201 / 0.141683 (-0.124482) | 1.105836 / 1.452155 (-0.346318) | 1.161559 / 1.492716 (-0.331158) |

### Benchmark: benchmark_getitem\_100B.json

| metric | get_batch_of\_1024\_random_rows | get_batch_of\_1024\_rows | get_first_row | get_last_row |
|--------|---|---|---|---|
| new / old (diff) | 0.090481 / 0.018006 (0.072475) | 0.299013 / 0.000490 (0.298524) | 0.000220 / 0.000200 (0.000020) | 0.000047 / 0.000054 (-0.000007) |

### Benchmark: benchmark_indices_mapping.json

| metric | select | shard | shuffle | sort | train_test_split |
|--------|---|---|---|---|---|
| new / old (diff) | 0.017684 / 0.037411 (-0.019727) | 0.061580 / 0.014526 (0.047054) | 0.074370 / 0.176557 (-0.102186) | 0.119468 / 0.737135 (-0.617667) | 0.074671 / 0.296338 (-0.221668) |

### Benchmark: benchmark_iterating.json

| metric | read 5000 | read 50000 | read_batch 50000 10 | read_batch 50000 100 | read_batch 50000 1000 | read_formatted numpy 5000 | read_formatted pandas 5000 | read_formatted tensorflow 5000 | read_formatted torch 5000 | read_formatted_batch numpy 5000 10 | read_formatted_batch numpy 5000 1000 | shuffled read 5000 | shuffled read 50000 | shuffled read_batch 50000 10 | shuffled read_batch 50000 100 | shuffled read_batch 50000 1000 | shuffled read_formatted numpy 5000 | shuffled read_formatted_batch numpy 5000 10 | shuffled read_formatted_batch numpy 5000 1000 |
|--------|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| new / old (diff) | 0.284778 / 0.215209 (0.069569) | 2.780241 / 2.077655 (0.702586) | 1.504025 / 1.504120 (-0.000095) | 1.386644 / 1.541195 (-0.154550) | 1.402038 / 1.468490 (-0.066452) | 0.555180 / 4.584777 (-4.029597) | 2.410973 / 3.745712 (-1.334740) | 2.773252 / 5.269862 (-2.496610) | 1.722784 / 4.565676 (-2.842892) | 0.062773 / 0.424275 (-0.361502) | 0.004959 / 0.007607 (-0.002648) | 0.337163 / 0.226044 (0.111119) | 3.356947 / 2.268929 (1.088019) | 1.880953 / 55.444624 (-53.563671) | 1.556049 / 6.876477 (-5.320427) | 1.578589 / 2.142072 (-0.563483) | 0.641993 / 4.805227 (-4.163234) | 0.118624 / 6.500664 (-6.382040) | 0.042202 / 0.075469 (-0.033268) |

### Benchmark: benchmark_map_filter.json

| metric | filter | map fast-tokenizer batched | map identity | map identity batched | map no-op batched | map no-op batched numpy | map no-op batched pandas | map no-op batched pytorch | map no-op batched tensorflow |
|--------|---|---|---|---|---|---|---|---|---|
| new / old (diff) | 0.995321 / 1.841788 (-0.846467) | 12.257597 / 8.074308 (4.183289) | 9.646214 / 10.191392 (-0.545178) | 0.131124 / 0.680424 (-0.549300) | 0.014119 / 0.534201 (-0.520082) | 0.287597 / 0.579283 (-0.291686) | 0.266983 / 0.434364 (-0.167381) | 0.328165 / 0.540337 (-0.212173) | 0.422405 / 1.386936 (-0.964531) |

</details>
PyArrow==latest

<details>
<summary>Show updated benchmarks!</summary>

### Benchmark: benchmark_array_xd.json

| metric | read_batch_formatted_as_numpy after write_array2d | read_batch_formatted_as_numpy after write_flattened_sequence | read_batch_formatted_as_numpy after write_nested_sequence | read_batch_unformated after write_array2d | read_batch_unformated after write_flattened_sequence | read_batch_unformated after write_nested_sequence | read_col_formatted_as_numpy after write_array2d | read_col_formatted_as_numpy after write_flattened_sequence | read_col_formatted_as_numpy after write_nested_sequence | read_col_unformated after write_array2d | read_col_unformated after write_flattened_sequence | read_col_unformated after write_nested_sequence | read_formatted_as_numpy after write_array2d | read_formatted_as_numpy after write_flattened_sequence | read_formatted_as_numpy after write_nested_sequence | read_unformated after write_array2d | read_unformated after write_flattened_sequence | read_unformated after write_nested_sequence | write_array2d | write_flattened_sequence | write_nested_sequence |
|--------|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| new / old (diff) | 0.005091 / 0.011353 (-0.006262) | 0.003358 / 0.011008 (-0.007650) | 0.049136 / 0.038508 (0.010628) | 0.031075 / 0.023109 (0.007966) | 0.275047 / 0.275898 (-0.000851) | 0.296845 / 0.323480 (-0.026635) | 0.004949 / 0.007986 (-0.003037) | 0.002586 / 0.004328 (-0.001743) | 0.048164 / 0.004250 (0.043913) | 0.040754 / 0.037052 (0.003702) | 0.288715 / 0.258489 (0.030226) | 0.312383 / 0.293841 (0.018542) | 0.029372 / 0.128546 (-0.099174) | 0.010097 / 0.075646 (-0.065549) | 0.056752 / 0.419271 (-0.362520) | 0.033128 / 0.043533 (-0.010405) | 0.274986 / 0.255139 (0.019847) | 0.292692 / 0.283200 (0.009493) | 0.018309 / 0.141683 (-0.123374) | 1.190320 / 1.452155 (-0.261834) | 1.222529 / 1.492716 (-0.270188) |

### Benchmark: benchmark_getitem\_100B.json

| metric | get_batch_of\_1024\_random_rows | get_batch_of\_1024\_rows | get_first_row | get_last_row |
|--------|---|---|---|---|
| new / old (diff) | 0.091717 / 0.018006 (0.073711) | 0.300278 / 0.000490 (0.299788) | 0.000217 / 0.000200 (0.000017) | 0.000065 / 0.000054 (0.000011) |

### Benchmark: benchmark_indices_mapping.json

| metric | select | shard | shuffle | sort | train_test_split |
|--------|---|---|---|---|---|
| new / old (diff) | 0.021394 / 0.037411 (-0.016018) | 0.074918 / 0.014526 (0.060392) | 0.087461 / 0.176557 (-0.089095) | 0.125499 / 0.737135 (-0.611636) | 0.087484 / 0.296338 (-0.208854) |

### Benchmark: benchmark_iterating.json

| metric | read 5000 | read 50000 | read_batch 50000 10 | read_batch 50000 100 | read_batch 50000 1000 | read_formatted numpy 5000 | read_formatted pandas 5000 | read_formatted tensorflow 5000 | read_formatted torch 5000 | read_formatted_batch numpy 5000 10 | read_formatted_batch numpy 5000 1000 | shuffled read 5000 | shuffled read 50000 | shuffled read_batch 50000 10 | shuffled read_batch 50000 100 | shuffled read_batch 50000 1000 | shuffled read_formatted numpy 5000 | shuffled read_formatted_batch numpy 5000 10 | shuffled read_formatted_batch numpy 5000 1000 |
|--------|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| new / old (diff) | 0.296557 / 0.215209 (0.081348) | 2.905527 / 2.077655 (0.827872) | 1.624640 / 1.504120 (0.120520) | 1.505495 / 1.541195 (-0.035700) | 1.514066 / 1.468490 (0.045576) | 0.569376 / 4.584777 (-4.015401) | 2.448575 / 3.745712 (-1.297137) | 2.772805 / 5.269862 (-2.497057) | 1.757287 / 4.565676 (-2.808390) | 0.064209 / 0.424275 (-0.360066) | 0.005688 / 0.007607 (-0.001919) | 0.353175 / 0.226044 (0.127131) | 3.481591 / 2.268929 (1.212662) | 1.995384 / 55.444624 (-53.449240) | 1.684623 / 6.876477 (-5.191854) | 1.675750 / 2.142072 (-0.466323) | 0.644463 / 4.805227 (-4.160764) | 0.115393 / 6.500664 (-6.385271) | 0.040671 / 0.075469 (-0.034799) |

### Benchmark: benchmark_map_filter.json

| metric | filter | map fast-tokenizer batched | map identity | map identity batched | map no-op batched | map no-op batched numpy | map no-op batched pandas | map no-op batched pytorch | map no-op batched tensorflow |
|--------|---|---|---|---|---|---|---|---|---|
| new / old (diff) | 1.037487 / 1.841788 (-0.804301) | 11.902194 / 8.074308 (3.827886) | 10.148579 / 10.191392 (-0.042813) | 0.150261 / 0.680424 (-0.530163) | 0.015001 / 0.534201 (-0.519200) | 0.291008 / 0.579283 (-0.288275) | 0.278758 / 0.434364 (-0.155606) | 0.334037 / 0.540337 (-0.206301) | 0.419942 / 1.386936 (-0.966994) |

</details>
</details>

![](https://cml.dev/watermark.png#dcd01046388fc052d37acc5a450bea69e3c57afc "CML watermark")