Fix custom configs from script
State: closed | Author: lhoestq (MEMBER)

We should not use the parquet export when the user is passing config_kwargs

I also fixed a regression that would disallow creating a custom config when a dataset has multiple predefined configs

fix https://github.com/huggingface/datasets/issues/6533

Comments: The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_6544). 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.005462 / 0.011353 (-0.005891) | 0.003918 / 0.011008 (-0.007090) | 0.065021 / 0.038508 (0.026513) | 0.032620 / 0.023109 (0.009511) | 0.249794 / 0.275898 (-0.026104) | 0.277330 / 0.323480 (-0.046150) | 0.002962 / 0.007986 (-0.005023) | 0.003435 / 0.004328 (-0.000894) | 0.048992 / 0.004250 (0.044742) | 0.046841 / 0.037052 (0.009788) | 0.252459 / 0.258489 (-0.006030) | 0.287889 / 0.293841 (-0.005952) | 0.028322 / 0.128546 (-0.100224) | 0.011214 / 0.075646 (-0.064432) | 0.208555 / 0.419271 (-0.210717) | 0.037004 / 0.043533 (-0.006529) | 0.262537 / 0.255139 (0.007398) | 0.307418 / 0.283200 (0.024218) | 0.021552 / 0.141683 (-0.120131) | 1.144252 / 1.452155 (-0.307903) | 1.195687 / 1.492716 (-0.297029) |

### 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.004766 / 0.018006 (-0.013240) | 0.301926 / 0.000490 (0.301436) | 0.000218 / 0.000200 (0.000018) | 0.000042 / 0.000054 (-0.000012) |

### Benchmark: benchmark_indices_mapping.json

| metric | select | shard | shuffle | sort | train_test_split |
|--------|---|---|---|---|---|
| new / old (diff) | 0.017891 / 0.037411 (-0.019521) | 0.066848 / 0.014526 (0.052322) | 0.075522 / 0.176557 (-0.101035) | 0.120762 / 0.737135 (-0.616374) | 0.075980 / 0.296338 (-0.220359) |

### 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.284843 / 0.215209 (0.069634) | 2.816260 / 2.077655 (0.738605) | 1.484370 / 1.504120 (-0.019750) | 1.362090 / 1.541195 (-0.179104) | 1.421729 / 1.468490 (-0.046762) | 0.561673 / 4.584777 (-4.023104) | 2.370793 / 3.745712 (-1.374919) | 2.982639 / 5.269862 (-2.287223) | 1.834614 / 4.565676 (-2.731063) | 0.063158 / 0.424275 (-0.361117) | 0.005044 / 0.007607 (-0.002563) | 0.339834 / 0.226044 (0.113790) | 3.369051 / 2.268929 (1.100122) | 1.821040 / 55.444624 (-53.623584) | 1.544009 / 6.876477 (-5.332468) | 1.603902 / 2.142072 (-0.538171) | 0.638151 / 4.805227 (-4.167076) | 0.117012 / 6.500664 (-6.383652) | 0.042999 / 0.075469 (-0.032470) |

### 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.941809 / 1.841788 (-0.899978) | 12.279635 / 8.074308 (4.205326) | 10.212876 / 10.191392 (0.021484) | 0.129904 / 0.680424 (-0.550519) | 0.014210 / 0.534201 (-0.519991) | 0.286140 / 0.579283 (-0.293143) | 0.267453 / 0.434364 (-0.166911) | 0.324417 / 0.540337 (-0.215921) | 0.428262 / 1.386936 (-0.958674) |

</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.005351 / 0.011353 (-0.006002) | 0.003591 / 0.011008 (-0.007417) | 0.048755 / 0.038508 (0.010247) | 0.030857 / 0.023109 (0.007748) | 0.270301 / 0.275898 (-0.005597) | 0.294459 / 0.323480 (-0.029021) | 0.004265 / 0.007986 (-0.003720) | 0.002712 / 0.004328 (-0.001616) | 0.047725 / 0.004250 (0.043475) | 0.048392 / 0.037052 (0.011339) | 0.274226 / 0.258489 (0.015737) | 0.304010 / 0.293841 (0.010169) | 0.029283 / 0.128546 (-0.099263) | 0.011196 / 0.075646 (-0.064450) | 0.057213 / 0.419271 (-0.362058) | 0.057504 / 0.043533 (0.013971) | 0.266091 / 0.255139 (0.010952) | 0.285991 / 0.283200 (0.002791) | 0.020030 / 0.141683 (-0.121653) | 1.121514 / 1.452155 (-0.330641) | 1.192608 / 1.492716 (-0.300108) |

### 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.095041 / 0.018006 (0.077035) | 0.301255 / 0.000490 (0.300765) | 0.000218 / 0.000200 (0.000018) | 0.000044 / 0.000054 (-0.000010) |

### Benchmark: benchmark_indices_mapping.json

| metric | select | shard | shuffle | sort | train_test_split |
|--------|---|---|---|---|---|
| new / old (diff) | 0.022265 / 0.037411 (-0.015146) | 0.078416 / 0.014526 (0.063890) | 0.091097 / 0.176557 (-0.085460) | 0.129864 / 0.737135 (-0.607272) | 0.091683 / 0.296338 (-0.204655) |

### 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.294104 / 0.215209 (0.078895) | 2.886809 / 2.077655 (0.809154) | 1.601931 / 1.504120 (0.097811) | 1.469353 / 1.541195 (-0.071842) | 1.525132 / 1.468490 (0.056642) | 0.565164 / 4.584777 (-4.019613) | 2.432873 / 3.745712 (-1.312839) | 2.885849 / 5.269862 (-2.384013) | 1.780474 / 4.565676 (-2.785203) | 0.064358 / 0.424275 (-0.359917) | 0.005186 / 0.007607 (-0.002421) | 0.349374 / 0.226044 (0.123329) | 3.424751 / 2.268929 (1.155823) | 1.956874 / 55.444624 (-53.487750) | 1.679002 / 6.876477 (-5.197475) | 1.718821 / 2.142072 (-0.423252) | 0.656974 / 4.805227 (-4.148254) | 0.120645 / 6.500664 (-6.380019) | 0.042355 / 0.075469 (-0.033114) |

### 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.001923 / 1.841788 (-0.839864) | 13.208127 / 8.074308 (5.133819) | 11.164863 / 10.191392 (0.973471) | 0.131964 / 0.680424 (-0.548460) | 0.015344 / 0.534201 (-0.518857) | 0.287961 / 0.579283 (-0.291322) | 0.273986 / 0.434364 (-0.160378) | 0.327280 / 0.540337 (-0.213058) | 0.426761 / 1.386936 (-0.960175) |

</details>
</details>

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


Thanks for the fix and the patch release. This confirms that, as I suggested in the Summer, maybe we should avoid making a release right before leaving on holidays.