Fix memory issue in multiprocessing: Don't pickle table index
{'login': 'lhoestq', 'id': 42851186, 'node_id': 'MDQ6VXNlcjQyODUxMTg2', 'avatar_url': 'https://avatars.githubusercontent.com/u/42851186?v=4', 'gravatar_id': '', 'url': 'https://api.github.com/users/lhoestq', 'html_url': 'https://github.com/lhoestq', 'followers_url': 'https://api.github.com/users/lhoestq/followers', 'following_url': 'https://api.github.com/users/lhoestq/following{/other_user}', 'gists_url': 'https://api.github.com/users/lhoestq/gists{/gist_id}', 'starred_url': 'https://api.github.com/users/lhoestq/starred{/owner}{/repo}', 'subscriptions_url': 'https://api.github.com/users/lhoestq/subscriptions', 'organizations_url': 'https://api.github.com/users/lhoestq/orgs', 'repos_url': 'https://api.github.com/users/lhoestq/repos', 'events_url': 'https://api.github.com/users/lhoestq/events{/privacy}', 'received_events_url': 'https://api.github.com/users/lhoestq/received_events', 'type': 'User', 'site_admin': False}
[]
[]
['The code quality check is going to be fixed by #2265 '
 "The memory issue didn't come from `self.__dict__.copy()` but from the fact that this dict contains `_batches` which has all the batches of the table in it.\r\nTherefore for a MemoryMappedTable all the data in `_batches` were copied in memory when pickling and this is the issue."
 "I'm still investigating why we didn't catch this issue in the tests.\r\nThis test should have caught it but didn't:\r\n\r\nhttps://github.com/huggingface/datasets/blob/3db67f5ff6cbf807b129d2b4d1107af27623b608/tests/test_table.py#L350-L353"
 "I'll focus on the patch release and fix the test in another PR after the release"
 'Yes, I think it is better that way...']
{'url': 'https://api.github.com/repos/huggingface/datasets/pulls/2264', 'html_url': 'https://github.com/huggingface/datasets/pull/2264', 'diff_url': 'https://github.com/huggingface/datasets/pull/2264.diff', 'patch_url': 'https://github.com/huggingface/datasets/pull/2264.patch', 'merged_at': datetime.datetime(2021, 4, 26, 10, 8, 14)}
The table index is currently being pickled when doing multiprocessing, which brings all the record batches of the dataset in memory.

I fixed that by not pickling the index attributes. Therefore each process has to rebuild the index when unpickling the table.

Fix issue #2256

We'll do a patch release asap !
{'url': 'https://api.github.com/repos/huggingface/datasets/issues/2264/reactions', 'total_count': 2, '+1': 2, '-1': 0, 'laugh': 0, 'hooray': 0, 'confused': 0, 'heart': 0, 'rocket': 0, 'eyes': 0}