remove_columns is not in-place but the doc shows it is in-place
COLLABORATOR
Good catch! I've opened a PR with a fix in the `transformers` repo.
2024-02-28T18:48:51Z
https://github.com/huggingface/datasets/issues/6700#issuecomment-1969622266
https://api.github.com/repos/huggingface/datasets/issues/6700
IC_kwDODunzps51Zgz6
https://api.github.com/repos/huggingface/datasets/issues/comments/1969622266/reactions
2024-02-28T18:48:51Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1969622266
https://avatars.githubusercontent.com/u/47462742?v=4
https://api.github.com/users/mariosasko/events{/privacy}
https://api.github.com/users/mariosasko/followers
https://api.github.com/users/mariosasko/following{/other_user}
https://api.github.com/users/mariosasko/gists{/gist_id}
https://github.com/mariosasko
mariosasko
MDQ6VXNlcjQ3NDYyNzQy
https://api.github.com/users/mariosasko/orgs
https://api.github.com/users/mariosasko/received_events
https://api.github.com/users/mariosasko/repos
https://api.github.com/users/mariosasko/starred{/owner}{/repo}
https://api.github.com/users/mariosasko/subscriptions
User
https://api.github.com/users/mariosasko
public
NONE
@mariosasko Thanks!

Will the doc of `datasets` be updated?

I find some possible mistakes in doc about whether `remove_columns` is in-place.
1. [You can also remove a column using map() with remove_columns but the present method is in-place (doesn’t copy the data to a new dataset) and is thus faster.](https://huggingface.co/docs/datasets/v2.17.1/en/package_reference/main_classes#datasets.Dataset.remove_columns)
2. [You can also remove a column using Dataset.map() with remove_columns but the present method is in-place (doesn’t copy the data to a new dataset) and is thus faster.](https://huggingface.co/docs/datasets/v2.17.1/en/package_reference/main_classes#datasets.DatasetDict.remove_columns)
3. [🤗 Datasets also has a remove_columns() function which is faster because it doesn’t copy the data of the remaining columns.](https://huggingface.co/docs/datasets/v2.17.1/en/process#map)
2024-02-29T03:02:52Z
https://github.com/huggingface/datasets/issues/6700#issuecomment-1970311766
https://api.github.com/repos/huggingface/datasets/issues/6700
IC_kwDODunzps51cJJW
https://api.github.com/repos/huggingface/datasets/issues/comments/1970311766/reactions
2024-02-29T03:02:52Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1970311766
https://avatars.githubusercontent.com/u/32047804?v=4
https://api.github.com/users/shelfofclub/events{/privacy}
https://api.github.com/users/shelfofclub/followers
https://api.github.com/users/shelfofclub/following{/other_user}
https://api.github.com/users/shelfofclub/gists{/gist_id}
https://github.com/shelfofclub
shelfofclub
MDQ6VXNlcjMyMDQ3ODA0
https://api.github.com/users/shelfofclub/orgs
https://api.github.com/users/shelfofclub/received_events
https://api.github.com/users/shelfofclub/repos
https://api.github.com/users/shelfofclub/starred{/owner}{/repo}
https://api.github.com/users/shelfofclub/subscriptions
User
https://api.github.com/users/shelfofclub
public
COLLABORATOR
I've linked a PR that will fix the usage in the `datasets` docs.
2024-04-02T15:43:03Z
https://github.com/huggingface/datasets/issues/6700#issuecomment-2032414696
https://api.github.com/repos/huggingface/datasets/issues/6700
IC_kwDODunzps55JC_o
https://api.github.com/repos/huggingface/datasets/issues/comments/2032414696/reactions
2024-04-02T15:43:14Z
https://api.github.com/repos/huggingface/datasets/issues/comments/2032414696
https://avatars.githubusercontent.com/u/47462742?v=4
https://api.github.com/users/mariosasko/events{/privacy}
https://api.github.com/users/mariosasko/followers
https://api.github.com/users/mariosasko/following{/other_user}
https://api.github.com/users/mariosasko/gists{/gist_id}
https://github.com/mariosasko
mariosasko
MDQ6VXNlcjQ3NDYyNzQy
https://api.github.com/users/mariosasko/orgs
https://api.github.com/users/mariosasko/received_events
https://api.github.com/users/mariosasko/repos
https://api.github.com/users/mariosasko/starred{/owner}{/repo}
https://api.github.com/users/mariosasko/subscriptions
User
https://api.github.com/users/mariosasko
public
### Describe the bug

The doc of `datasets` v2.17.0/v2.17.1 shows that `remove_columns` is in-place. [link](https://huggingface.co/docs/datasets/v2.17.1/en/package_reference/main_classes#datasets.DatasetDict.remove_columns)

In the text classification example of transformers v4.38.1, the columns are not removed.
https://github.com/huggingface/transformers/blob/a0857740c0e6127485c11476650314df3accc2b6/examples/pytorch/text-classification/run_classification.py#L421

### Steps to reproduce the bug

https://github.com/huggingface/transformers/blob/a0857740c0e6127485c11476650314df3accc2b6/examples/pytorch/text-classification/run_classification.py#L421

### Expected behavior

Actually remove the columns.

### Environment info

1. datasets v2.17.0
2. transformers v4.38.1