Support ruff 0.5.0 in CI

Support ruff 0.5.0 in CI and revert:
- #7007

Fix #7008.

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7009). 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.005481 / 0.011353 (-0.005872) | 0.003580 / 0.011008 (-0.007428) | 0.062682 / 0.038508 (0.024174) | 0.031125 / 0.023109 (0.008015) | 0.239443 / 0.275898 (-0.036455) | 0.262950 / 0.323480 (-0.060529) | 0.003129 / 0.007986 (-0.004857) | 0.003393 / 0.004328 (-0.000935) | 0.048765 / 0.004250 (0.044514) | 0.044363 / 0.037052 (0.007311) | 0.248632 / 0.258489 (-0.009857) | 0.285056 / 0.293841 (-0.008785) | 0.029674 / 0.128546 (-0.098872) | 0.011963 / 0.075646 (-0.063684) | 0.204122 / 0.419271 (-0.215150) | 0.035867 / 0.043533 (-0.007665) | 0.245422 / 0.255139 (-0.009717) | 0.267165 / 0.283200 (-0.016035) | 0.018556 / 0.141683 (-0.123127) | 1.132112 / 1.452155 (-0.320043) | 1.173512 / 1.492716 (-0.319204) |

### 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.092749 / 0.018006 (0.074743) | 0.298946 / 0.000490 (0.298457) | 0.000211 / 0.000200 (0.000011) | 0.000044 / 0.000054 (-0.000011) |

### Benchmark: benchmark_indices_mapping.json

| metric | select | shard | shuffle | sort | train_test_split |
|--------|---|---|---|---|---|
| new / old (diff) | 0.019496 / 0.037411 (-0.017915) | 0.062209 / 0.014526 (0.047683) | 0.074656 / 0.176557 (-0.101901) | 0.121238 / 0.737135 (-0.615897) | 0.075810 / 0.296338 (-0.220528) |

### 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.278089 / 0.215209 (0.062880) | 2.725602 / 2.077655 (0.647948) | 1.413346 / 1.504120 (-0.090774) | 1.290352 / 1.541195 (-0.250843) | 1.306732 / 1.468490 (-0.161758) | 0.713945 / 4.584777 (-3.870832) | 2.380131 / 3.745712 (-1.365581) | 2.804548 / 5.269862 (-2.465314) | 1.896506 / 4.565676 (-2.669170) | 0.078303 / 0.424275 (-0.345972) | 0.005475 / 0.007607 (-0.002132) | 0.340162 / 0.226044 (0.114117) | 3.355732 / 2.268929 (1.086803) | 1.776012 / 55.444624 (-53.668613) | 1.507006 / 6.876477 (-5.369471) | 1.607234 / 2.142072 (-0.534838) | 0.796458 / 4.805227 (-4.008769) | 0.135888 / 6.500664 (-6.364776) | 0.042352 / 0.075469 (-0.033118) |

### 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.988337 / 1.841788 (-0.853450) | 11.299311 / 8.074308 (3.225003) | 9.166845 / 10.191392 (-1.024547) | 0.140351 / 0.680424 (-0.540073) | 0.013932 / 0.534201 (-0.520269) | 0.302157 / 0.579283 (-0.277126) | 0.259355 / 0.434364 (-0.175009) | 0.339850 / 0.540337 (-0.200488) | 0.465345 / 1.386936 (-0.921591) |

</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.005707 / 0.011353 (-0.005646) | 0.003846 / 0.011008 (-0.007162) | 0.050100 / 0.038508 (0.011591) | 0.031810 / 0.023109 (0.008701) | 0.265120 / 0.275898 (-0.010778) | 0.286635 / 0.323480 (-0.036845) | 0.004329 / 0.007986 (-0.003657) | 0.002757 / 0.004328 (-0.001571) | 0.050864 / 0.004250 (0.046614) | 0.039872 / 0.037052 (0.002820) | 0.277675 / 0.258489 (0.019186) | 0.310251 / 0.293841 (0.016410) | 0.032458 / 0.128546 (-0.096088) | 0.012072 / 0.075646 (-0.063574) | 0.060539 / 0.419271 (-0.358733) | 0.033772 / 0.043533 (-0.009761) | 0.265992 / 0.255139 (0.010853) | 0.286152 / 0.283200 (0.002953) | 0.018210 / 0.141683 (-0.123473) | 1.151461 / 1.452155 (-0.300694) | 1.199998 / 1.492716 (-0.292718) |

### 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.094109 / 0.018006 (0.076103) | 0.298190 / 0.000490 (0.297701) | 0.000199 / 0.000200 (-0.000001) | 0.000045 / 0.000054 (-0.000010) |

### Benchmark: benchmark_indices_mapping.json

| metric | select | shard | shuffle | sort | train_test_split |
|--------|---|---|---|---|---|
| new / old (diff) | 0.022431 / 0.037411 (-0.014980) | 0.076319 / 0.014526 (0.061794) | 0.090023 / 0.176557 (-0.086533) | 0.128189 / 0.737135 (-0.608946) | 0.089564 / 0.296338 (-0.206774) |

### 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.298887 / 0.215209 (0.083678) | 2.928580 / 2.077655 (0.850926) | 1.565379 / 1.504120 (0.061259) | 1.424704 / 1.541195 (-0.116490) | 1.446336 / 1.468490 (-0.022154) | 0.716348 / 4.584777 (-3.868429) | 0.967465 / 3.745712 (-2.778247) | 2.967318 / 5.269862 (-2.302544) | 1.918878 / 4.565676 (-2.646798) | 0.077167 / 0.424275 (-0.347108) | 0.005271 / 0.007607 (-0.002336) | 0.342376 / 0.226044 (0.116332) | 3.386044 / 2.268929 (1.117115) | 1.915308 / 55.444624 (-53.529316) | 1.612729 / 6.876477 (-5.263748) | 1.621278 / 2.142072 (-0.520794) | 0.804639 / 4.805227 (-4.000589) | 0.132596 / 6.500664 (-6.368069) | 0.041075 / 0.075469 (-0.034394) |

### 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.996521 / 1.841788 (-0.845267) | 12.328856 / 8.074308 (4.254548) | 10.585154 / 10.191392 (0.393762) | 0.131720 / 0.680424 (-0.548704) | 0.016777 / 0.534201 (-0.517424) | 0.300424 / 0.579283 (-0.278860) | 0.128526 / 0.434364 (-0.305838) | 0.339961 / 0.540337 (-0.200377) | 0.441661 / 1.386936 (-0.945275) |

</details>
</details>

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