changes to MappedExamplesIterable to resolve #7345
CONTRIBUTOR
I noticed that `Dataset.map` has a more complex output depending on `remove_columns`. In particular [this](https://github.com/huggingface/datasets/blob/6457be66e2ef88411281eddc4e7698866a3977f1/src/datasets/arrow_dataset.py#L3371) line removes columns from output if the input is being modified in place (i.e. `input_columns = None`). I tried to mimic this behaviour in `MappedExamplesIterable` by checking if the input and output point to the same dictionary object.
2025-01-04T22:23:17Z
https://github.com/huggingface/datasets/pull/7353#issuecomment-2571426820
https://api.github.com/repos/huggingface/datasets/issues/7353
IC_kwDODunzps6ZRNwE
https://api.github.com/repos/huggingface/datasets/issues/comments/2571426820/reactions
2025-01-04T22:24:46Z
https://api.github.com/repos/huggingface/datasets/issues/comments/2571426820
https://avatars.githubusercontent.com/u/12157034?v=4
https://api.github.com/users/vttrifonov/events{/privacy}
https://api.github.com/users/vttrifonov/followers
https://api.github.com/users/vttrifonov/following{/other_user}
https://api.github.com/users/vttrifonov/gists{/gist_id}
https://github.com/vttrifonov
vttrifonov
MDQ6VXNlcjEyMTU3MDM0
https://api.github.com/users/vttrifonov/orgs
https://api.github.com/users/vttrifonov/received_events
https://api.github.com/users/vttrifonov/repos
https://api.github.com/users/vttrifonov/starred{/owner}{/repo}
https://api.github.com/users/vttrifonov/subscriptions
User
https://api.github.com/users/vttrifonov
public
NONE
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7353). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
2025-01-06T14:53:52Z
https://github.com/huggingface/datasets/pull/7353#issuecomment-2573277386
https://api.github.com/repos/huggingface/datasets/issues/7353
IC_kwDODunzps6ZYRjK
https://api.github.com/repos/huggingface/datasets/issues/comments/2573277386/reactions
2025-01-06T14:53:52Z
https://api.github.com/repos/huggingface/datasets/issues/comments/2573277386
https://avatars.githubusercontent.com/u/99929124?v=4
https://api.github.com/users/HuggingFaceDocBuilderDev/events{/privacy}
https://api.github.com/users/HuggingFaceDocBuilderDev/followers
https://api.github.com/users/HuggingFaceDocBuilderDev/following{/other_user}
https://api.github.com/users/HuggingFaceDocBuilderDev/gists{/gist_id}
https://github.com/HuggingFaceDocBuilderDev
HuggingFaceDocBuilderDev
U_kgDOBfTMJA
https://api.github.com/users/HuggingFaceDocBuilderDev/orgs
https://api.github.com/users/HuggingFaceDocBuilderDev/received_events
https://api.github.com/users/HuggingFaceDocBuilderDev/repos
https://api.github.com/users/HuggingFaceDocBuilderDev/starred{/owner}{/repo}
https://api.github.com/users/HuggingFaceDocBuilderDev/subscriptions
User
https://api.github.com/users/HuggingFaceDocBuilderDev
public
modified `MappedExamplesIterable` and `test_iterable_dataset.py::test_mapped_examples_iterable_with_indices`

fix #7345

@lhoestq 