Fix: Prevent loss of info.features and column_names in IterableDatasetDict.map when features is None
Hi!
I haven’t included a test for this change, as the fix is quite small and targeted.
Please let me know if you’d like a test for this case or if you’d prefer to handle it during review.
Thanks! we can't know in advance the `features` after map() (it transforms the data !), so you can reuse the `features` from `info.features` I'll the patch as suggested — `info.features = features` or `self.info.features` — to ensure schema preservation while keeping the logic simple and explicit. WDYT?
 info.features should be None in the general case, and replaced by the user's `features` if it's passed explicitly with `map(..., features=...)`

https://github.com/huggingface/datasets/issues/7568 is not an issue we can fix > info.features should be None in the general case, and replaced by the user's `features` if it's passed explicitly with `map(..., features=...)`
> 
> #7568 is not an issue we can fix

Thanks for the clarification! Totally makes sense now — I understand that features=None is the expected behavior post-map() unless explicitly passed, and that preserving old schema by default could lead to incorrect assumptions.
Closing this one — appreciate the feedback as always
This PR fixes a bug where calling `IterableDatasetDict.map()` or `IterableDataset.map()` with the default `features=None` argument would overwrite the existing `info.features` attribute with `None`. This, in turn, caused the resulting dataset to lose its schema, breaking downstream usage of attributes like `column_names`.

Why
Previously, the code would always set `info.features = features`, even if `features` was `None`. When mapping with removal of columns or other transformations, this led to the destruction of the schema and caused failures in code that relied on the dataset schema being present.

How
We now update `info.features` only if `features` is not `None`. This preserves the original schema unless the user explicitly provides a new one.

Reference
Fixes #7568