Replace flatten_nested
MEMBER
Hi @lhoestq. If you agree to merge this, I will start separating the logic for NestedDataStructure.map ;)
2021-02-19T13:11:21Z
https://github.com/huggingface/datasets/pull/1879#issuecomment-782064979
https://api.github.com/repos/huggingface/datasets/issues/1879
MDEyOklzc3VlQ29tbWVudDc4MjA2NDk3OQ==
https://api.github.com/repos/huggingface/datasets/issues/comments/782064979/reactions
2021-02-19T13:11:21Z
https://api.github.com/repos/huggingface/datasets/issues/comments/782064979
https://avatars.githubusercontent.com/u/8515462?v=4
https://api.github.com/users/albertvillanova/events{/privacy}
https://api.github.com/users/albertvillanova/followers
https://api.github.com/users/albertvillanova/following{/other_user}
https://api.github.com/users/albertvillanova/gists{/gist_id}
https://github.com/albertvillanova
albertvillanova
MDQ6VXNlcjg1MTU0NjI=
https://api.github.com/users/albertvillanova/orgs
https://api.github.com/users/albertvillanova/received_events
https://api.github.com/users/albertvillanova/repos
https://api.github.com/users/albertvillanova/starred{/owner}{/repo}
https://api.github.com/users/albertvillanova/subscriptions
User
https://api.github.com/users/albertvillanova
public
Replace `flatten_nested` with `NestedDataStructure.flatten`.

This is a first step towards having all NestedDataStructure logic as a separated concern, independent of the caller/user of the data structure.

Eventually, all checks (whether the underlying data is list, dict, etc.) will be only inside this class.

I have also generalized the flattening, and now it handles multiple levels of nesting.