Fix python formatting for complex types in `format_table`

Fix #6366

Comments:
<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.008047 / 0.011353 (-0.003305) | 0.004649 / 0.011008 (-0.006359) | 0.100275 / 0.038508 (0.061767) | 0.089551 / 0.023109 (0.066442) | 0.369831 / 0.275898 (0.093933) | 0.431023 / 0.323480 (0.107544) | 0.004721 / 0.007986 (-0.003265) | 0.004904 / 0.004328 (0.000575) | 0.076345 / 0.004250 (0.072095) | 0.066902 / 0.037052 (0.029849) | 0.377208 / 0.258489 (0.118718) | 0.430989 / 0.293841 (0.137148) | 0.036260 / 0.128546 (-0.092287) | 0.010158 / 0.075646 (-0.065488) | 0.344923 / 0.419271 (-0.074349) | 0.062504 / 0.043533 (0.018971) | 0.373038 / 0.255139 (0.117899) | 0.399918 / 0.283200 (0.116718) | 0.028257 / 0.141683 (-0.113425) | 1.782546 / 1.452155 (0.330391) | 1.920010 / 1.492716 (0.427293) |

### 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.277670 / 0.018006 (0.259664) | 0.500543 / 0.000490 (0.500053) | 0.018256 / 0.000200 (0.018056) | 0.000343 / 0.000054 (0.000289) |

### Benchmark: benchmark_indices_mapping.json

| metric | select | shard | shuffle | sort | train_test_split |
|--------|---|---|---|---|---|
| new / old (diff) | 0.033337 / 0.037411 (-0.004074) | 0.100542 / 0.014526 (0.086017) | 0.114903 / 0.176557 (-0.061654) | 0.181267 / 0.737135 (-0.555868) | 0.115019 / 0.296338 (-0.181320) |

### 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.457333 / 0.215209 (0.242124) | 4.542082 / 2.077655 (2.464427) | 2.231817 / 1.504120 (0.727697) | 2.028523 / 1.541195 (0.487328) | 2.110715 / 1.468490 (0.642225) | 0.583162 / 4.584777 (-4.001615) | 4.179413 / 3.745712 (0.433701) | 4.145620 / 5.269862 (-1.124241) | 2.452458 / 4.565676 (-2.113218) | 0.068229 / 0.424275 (-0.356046) | 0.009027 / 0.007607 (0.001420) | 0.549002 / 0.226044 (0.322957) | 5.485707 / 2.268929 (3.216779) | 2.789467 / 55.444624 (-52.655157) | 2.397499 / 6.876477 (-4.478977) | 2.492083 / 2.142072 (0.350010) | 0.692445 / 4.805227 (-4.112782) | 0.160527 / 6.500664 (-6.340137) | 0.071597 / 0.075469 (-0.003872) |

### 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.486043 / 1.841788 (-0.355744) | 22.377207 / 8.074308 (14.302899) | 16.443719 / 10.191392 (6.252327) | 0.170740 / 0.680424 (-0.509684) | 0.021511 / 0.534201 (-0.512690) | 0.470798 / 0.579283 (-0.108485) | 0.511851 / 0.434364 (0.077487) | 0.551154 / 0.540337 (0.010817) | 0.768420 / 1.386936 (-0.618516) |

</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.008049 / 0.011353 (-0.003303) | 0.004676 / 0.011008 (-0.006332) | 0.076360 / 0.038508 (0.037852) | 0.093648 / 0.023109 (0.070539) | 0.480597 / 0.275898 (0.204699) | 0.524674 / 0.323480 (0.201194) | 0.006242 / 0.007986 (-0.001744) | 0.003827 / 0.004328 (-0.000501) | 0.077039 / 0.004250 (0.072788) | 0.067992 / 0.037052 (0.030940) | 0.480287 / 0.258489 (0.221798) | 0.528546 / 0.293841 (0.234706) | 0.038347 / 0.128546 (-0.090199) | 0.010036 / 0.075646 (-0.065611) | 0.084386 / 0.419271 (-0.334885) | 0.057211 / 0.043533 (0.013678) | 0.475993 / 0.255139 (0.220854) | 0.504881 / 0.283200 (0.221682) | 0.026658 / 0.141683 (-0.115025) | 1.777095 / 1.452155 (0.324940) | 1.896446 / 1.492716 (0.403730) |

### 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.242450 / 0.018006 (0.224443) | 0.488864 / 0.000490 (0.488374) | 0.007329 / 0.000200 (0.007129) | 0.000108 / 0.000054 (0.000053) |

### Benchmark: benchmark_indices_mapping.json

| metric | select | shard | shuffle | sort | train_test_split |
|--------|---|---|---|---|---|
| new / old (diff) | 0.039093 / 0.037411 (0.001682) | 0.114724 / 0.014526 (0.100198) | 0.124965 / 0.176557 (-0.051591) | 0.188165 / 0.737135 (-0.548971) | 0.125336 / 0.296338 (-0.171002) |

### 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.515718 / 0.215209 (0.300509) | 5.150865 / 2.077655 (3.073210) | 2.767866 / 1.504120 (1.263746) | 2.571003 / 1.541195 (1.029808) | 2.656224 / 1.468490 (1.187734) | 0.583771 / 4.584777 (-4.001006) | 4.268713 / 3.745712 (0.523001) | 3.938699 / 5.269862 (-1.331163) | 2.413569 / 4.565676 (-2.152108) | 0.068848 / 0.424275 (-0.355427) | 0.008758 / 0.007607 (0.001151) | 0.610831 / 0.226044 (0.384786) | 6.099965 / 2.268929 (3.831037) | 3.337530 / 55.444624 (-52.107095) | 2.910962 / 6.876477 (-3.965514) | 3.149813 / 2.142072 (1.007740) | 0.700576 / 4.805227 (-4.104651) | 0.157569 / 6.500664 (-6.343095) | 0.072237 / 0.075469 (-0.003232) |

### 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.655840 / 1.841788 (-0.185947) | 23.639061 / 8.074308 (15.564753) | 17.301593 / 10.191392 (7.110201) | 0.201717 / 0.680424 (-0.478707) | 0.023836 / 0.534201 (-0.510365) | 0.470941 / 0.579283 (-0.108342) | 0.498157 / 0.434364 (0.063794) | 0.581195 / 0.540337 (0.040857) | 0.788304 / 1.386936 (-0.598632) |

</details>
</details>

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


_The documentation is not available anymore as the PR was closed or merged._

<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.004823 / 0.011353 (-0.006530) | 0.002976 / 0.011008 (-0.008032) | 0.062070 / 0.038508 (0.023562) | 0.051623 / 0.023109 (0.028513) | 0.242249 / 0.275898 (-0.033649) | 0.271223 / 0.323480 (-0.052257) | 0.003906 / 0.007986 (-0.004079) | 0.002709 / 0.004328 (-0.001620) | 0.047874 / 0.004250 (0.043624) | 0.038123 / 0.037052 (0.001071) | 0.253737 / 0.258489 (-0.004752) | 0.281942 / 0.293841 (-0.011899) | 0.023750 / 0.128546 (-0.104797) | 0.007227 / 0.075646 (-0.068420) | 0.203137 / 0.419271 (-0.216134) | 0.036254 / 0.043533 (-0.007278) | 0.243923 / 0.255139 (-0.011216) | 0.263908 / 0.283200 (-0.019291) | 0.017795 / 0.141683 (-0.123888) | 1.105680 / 1.452155 (-0.346475) | 1.166804 / 1.492716 (-0.325912) |

### 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.097388 / 0.018006 (0.079381) | 0.305481 / 0.000490 (0.304991) | 0.000210 / 0.000200 (0.000010) | 0.000043 / 0.000054 (-0.000012) |

### Benchmark: benchmark_indices_mapping.json

| metric | select | shard | shuffle | sort | train_test_split |
|--------|---|---|---|---|---|
| new / old (diff) | 0.020096 / 0.037411 (-0.017315) | 0.063990 / 0.014526 (0.049464) | 0.073694 / 0.176557 (-0.102863) | 0.122909 / 0.737135 (-0.614227) | 0.076199 / 0.296338 (-0.220140) |

### 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.285612 / 0.215209 (0.070403) | 2.770524 / 2.077655 (0.692869) | 1.451624 / 1.504120 (-0.052496) | 1.329223 / 1.541195 (-0.211972) | 1.369980 / 1.468490 (-0.098510) | 0.398269 / 4.584777 (-4.186507) | 2.418740 / 3.745712 (-1.326972) | 2.796384 / 5.269862 (-2.473478) | 1.686490 / 4.565676 (-2.879186) | 0.046417 / 0.424275 (-0.377858) | 0.005414 / 0.007607 (-0.002193) | 0.345505 / 0.226044 (0.119460) | 3.391857 / 2.268929 (1.122929) | 1.856696 / 55.444624 (-53.587929) | 1.538061 / 6.876477 (-5.338416) | 1.631489 / 2.142072 (-0.510584) | 0.479188 / 4.805227 (-4.326039) | 0.101549 / 6.500664 (-6.399116) | 0.042150 / 0.075469 (-0.033319) |

### 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.957961 / 1.841788 (-0.883827) | 12.349371 / 8.074308 (4.275063) | 10.778214 / 10.191392 (0.586822) | 0.141265 / 0.680424 (-0.539158) | 0.014559 / 0.534201 (-0.519642) | 0.272071 / 0.579283 (-0.307212) | 0.262493 / 0.434364 (-0.171871) | 0.310351 / 0.540337 (-0.229986) | 0.399220 / 1.386936 (-0.987716) |

</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.005127 / 0.011353 (-0.006226) | 0.002926 / 0.011008 (-0.008082) | 0.048320 / 0.038508 (0.009812) | 0.063082 / 0.023109 (0.039973) | 0.269846 / 0.275898 (-0.006052) | 0.294470 / 0.323480 (-0.029010) | 0.004201 / 0.007986 (-0.003784) | 0.002434 / 0.004328 (-0.001894) | 0.048020 / 0.004250 (0.043770) | 0.043909 / 0.037052 (0.006856) | 0.271328 / 0.258489 (0.012839) | 0.298820 / 0.293841 (0.004979) | 0.024565 / 0.128546 (-0.103981) | 0.007752 / 0.075646 (-0.067894) | 0.054171 / 0.419271 (-0.365101) | 0.033147 / 0.043533 (-0.010386) | 0.266628 / 0.255139 (0.011489) | 0.288651 / 0.283200 (0.005452) | 0.018910 / 0.141683 (-0.122773) | 1.153679 / 1.452155 (-0.298476) | 1.214979 / 1.492716 (-0.277737) |

### 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.097064 / 0.018006 (0.079057) | 0.307504 / 0.000490 (0.307014) | 0.000230 / 0.000200 (0.000030) | 0.000051 / 0.000054 (-0.000003) |

### Benchmark: benchmark_indices_mapping.json

| metric | select | shard | shuffle | sort | train_test_split |
|--------|---|---|---|---|---|
| new / old (diff) | 0.021848 / 0.037411 (-0.015563) | 0.071159 / 0.014526 (0.056633) | 0.081310 / 0.176557 (-0.095247) | 0.120175 / 0.737135 (-0.616961) | 0.082619 / 0.296338 (-0.213720) |

### 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.296606 / 0.215209 (0.081397) | 2.908495 / 2.077655 (0.830840) | 1.606522 / 1.504120 (0.102402) | 1.528599 / 1.541195 (-0.012596) | 1.508332 / 1.468490 (0.039842) | 0.396336 / 4.584777 (-4.188441) | 2.449163 / 3.745712 (-1.296549) | 2.533372 / 5.269862 (-2.736490) | 1.623061 / 4.565676 (-2.942615) | 0.046723 / 0.424275 (-0.377552) | 0.005120 / 0.007607 (-0.002487) | 0.345763 / 0.226044 (0.119718) | 3.427382 / 2.268929 (1.158454) | 1.962806 / 55.444624 (-53.481819) | 1.678548 / 6.876477 (-5.197929) | 1.865773 / 2.142072 (-0.276300) | 0.477932 / 4.805227 (-4.327295) | 0.100994 / 6.500664 (-6.399670) | 0.042212 / 0.075469 (-0.033258) |

### 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.992766 / 1.841788 (-0.849022) | 12.764885 / 8.074308 (4.690577) | 10.892094 / 10.191392 (0.700702) | 0.143211 / 0.680424 (-0.537213) | 0.016347 / 0.534201 (-0.517853) | 0.270181 / 0.579283 (-0.309102) | 0.278658 / 0.434364 (-0.155706) | 0.307134 / 0.540337 (-0.233203) | 0.396792 / 1.386936 (-0.990144) |

</details>
</details>

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


Thanks for the fix ! It was probably my mistake (forgot to re-apply the features)