map() function removes columns when input_columns is not None
{'login': 'pramodith', 'id': 16939722, 'node_id': 'MDQ6VXNlcjE2OTM5NzIy', 'avatar_url': 'https://avatars.githubusercontent.com/u/16939722?v=4', 'gravatar_id': '', 'url': 'https://api.github.com/users/pramodith', 'html_url': 'https://github.com/pramodith', 'followers_url': 'https://api.github.com/users/pramodith/followers', 'following_url': 'https://api.github.com/users/pramodith/following{/other_user}', 'gists_url': 'https://api.github.com/users/pramodith/gists{/gist_id}', 'starred_url': 'https://api.github.com/users/pramodith/starred{/owner}{/repo}', 'subscriptions_url': 'https://api.github.com/users/pramodith/subscriptions', 'organizations_url': 'https://api.github.com/users/pramodith/orgs', 'repos_url': 'https://api.github.com/users/pramodith/repos', 'events_url': 'https://api.github.com/users/pramodith/events{/privacy}', 'received_events_url': 'https://api.github.com/users/pramodith/received_events', 'type': 'User', 'site_admin': False}
[{'id': 1935892857, 'node_id': 'MDU6TGFiZWwxOTM1ODkyODU3', 'url': 'https://api.github.com/repos/huggingface/datasets/labels/bug', 'name': 'bug', 'color': 'd73a4a', 'default': True, 'description': "Something isn't working"}]
[]
Hi! Thanks for reporting! This looks like a bug. I've just opened a PR with the fix. Awesome! Thank you. I'll close the issue once the PR gets merged. :-) I guess we should reopen after the revert by:
- #5006
## Describe the bug
The map function, removes features from the dataset that are not present in the _input_columns_ list of columns, despite the columns being removed not mentioned in the _remove_columns_ argument.
## Steps to reproduce the bug
```python
from datasets import Dataset
ds = Dataset.from_dict({"a" : [1,2,3],"b" : [0,1,0], "c" : [2,4,5]})

def double(x,y):
  x = x*2
  y = y*2
  return {"d" : x, "e" : y}

ds.map(double, input_columns=["a","c"])
```

## Expected results
```
Dataset({
    features: ['a', 'b', 'c', 'd', 'e'],
    num_rows: 3
})
```
## Actual results
```
Dataset({
    features: ['a', 'c', 'd', 'e'],
    num_rows: 3
})
```

In this specific example feature **b** should not be removed.

## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.4.0
- Platform: linux (colab)
- Python version: 3.7.13
- PyArrow version: 6.0.1

{'url': 'https://api.github.com/repos/huggingface/datasets/issues/4858/reactions', 'total_count': 0, '+1': 0, '-1': 0, 'laugh': 0, 'hooray': 0, 'confused': 0, 'heart': 0, 'rocket': 0, 'eyes': 0}