fix Dataset.map when num_procs > num rows
MEMBER
Hi ! Thanks for fixing this :)

Looks like you have tons of changes due to code formatting.
We're using `black` for this, with a custom line length. To run our code formatting, you just need to run
```
make style
```

Then for the windows error in the CI, I'm looking into it. It's probably just a file that isn't properly closed
2021-06-29T13:38:04Z
https://github.com/huggingface/datasets/pull/2560#issuecomment-870607701
https://api.github.com/repos/huggingface/datasets/issues/2560
MDEyOklzc3VlQ29tbWVudDg3MDYwNzcwMQ==
https://api.github.com/repos/huggingface/datasets/issues/comments/870607701/reactions
2021-06-29T13:38:04Z
https://api.github.com/repos/huggingface/datasets/issues/comments/870607701
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
MEMBER
CI is all green now ! Thanks :)

There are still many code formatting changes in your PR - probably due to the first commit you did.
To avoid conflicts with future PRs it would be nice to only have the changes related to the `num_proc` warning, and not have all those code formatting changes,

Could you try remove those code formatting changes ?

If it's easier for you, you can make a new branch from `master` if needed
2021-06-29T14:41:25Z
https://github.com/huggingface/datasets/pull/2560#issuecomment-870661593
https://api.github.com/repos/huggingface/datasets/issues/2560
MDEyOklzc3VlQ29tbWVudDg3MDY2MTU5Mw==
https://api.github.com/repos/huggingface/datasets/issues/comments/870661593/reactions
2021-06-29T14:41:25Z
https://api.github.com/repos/huggingface/datasets/issues/comments/870661593
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
CONTRIBUTOR
Thanks, @lhoestq! Apologies for the half-baked commits yesterday! I wasn’t able to step back in to resolve those CI issues until this morning.

Also, I’m surprised that `make style` isn’t resolving the formatting changes. I’m a bit stumped on that, so I’m going to re-apply on a new branch and open a PR as you suggested.
2021-06-29T14:53:31Z
https://github.com/huggingface/datasets/pull/2560#issuecomment-870671231
https://api.github.com/repos/huggingface/datasets/issues/2560
MDEyOklzc3VlQ29tbWVudDg3MDY3MTIzMQ==
https://api.github.com/repos/huggingface/datasets/issues/comments/870671231/reactions
2021-06-29T14:53:31Z
https://api.github.com/repos/huggingface/datasets/issues/comments/870671231
https://avatars.githubusercontent.com/u/55268212?v=4
https://api.github.com/users/connor-mccarthy/events{/privacy}
https://api.github.com/users/connor-mccarthy/followers
https://api.github.com/users/connor-mccarthy/following{/other_user}
https://api.github.com/users/connor-mccarthy/gists{/gist_id}
https://github.com/connor-mccarthy
connor-mccarthy
MDQ6VXNlcjU1MjY4MjEy
https://api.github.com/users/connor-mccarthy/orgs
https://api.github.com/users/connor-mccarthy/received_events
https://api.github.com/users/connor-mccarthy/repos
https://api.github.com/users/connor-mccarthy/starred{/owner}{/repo}
https://api.github.com/users/connor-mccarthy/subscriptions
User
https://api.github.com/users/connor-mccarthy
public
closes #2470

## Testing notes
To run updated tests:
```sh
pytest tests/test_arrow_dataset.py -k "BaseDatasetTest and test_map_multiprocessing" -s
```
With Python code (to view warning):
```python
from datasets import Dataset


dataset = Dataset.from_dict({"x": ["sample"]})
print(len(dataset))
dataset.map(lambda x: x, num_proc=10)
```