Chain filtering is leaking
{'login': 'DrMatters', 'id': 22641583, 'node_id': 'MDQ6VXNlcjIyNjQxNTgz', 'avatar_url': 'https://avatars.githubusercontent.com/u/22641583?v=4', 'gravatar_id': '', 'url': 'https://api.github.com/users/DrMatters', 'html_url': 'https://github.com/DrMatters', 'followers_url': 'https://api.github.com/users/DrMatters/followers', 'following_url': 'https://api.github.com/users/DrMatters/following{/other_user}', 'gists_url': 'https://api.github.com/users/DrMatters/gists{/gist_id}', 'starred_url': 'https://api.github.com/users/DrMatters/starred{/owner}{/repo}', 'subscriptions_url': 'https://api.github.com/users/DrMatters/subscriptions', 'organizations_url': 'https://api.github.com/users/DrMatters/orgs', 'repos_url': 'https://api.github.com/users/DrMatters/repos', 'events_url': 'https://api.github.com/users/DrMatters/events{/privacy}', 'received_events_url': 'https://api.github.com/users/DrMatters/received_events', 'type': 'User', 'site_admin': False}
[{'id': 1935892857, 'node_id': 'MDU6TGFiZWwxOTM1ODkyODU3', 'url': 'https://api.github.com/repos/huggingface/datasets/labels/bug', 'name': 'bug', 'color': 'd73a4a', 'default': True, 'description': "Something isn't working"}]
{'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}
[{'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}]
["### Update:\r\nI wrote a bit cleaner code snippet (without transforming to json) that can expose leaking.\r\n```python\r\nimport datasets\r\nimport json\r\n\r\nitems = ['ab', 'c', 'df']\r\n\r\nds = datasets.Dataset.from_dict({'col': items})\r\nprint(list(ds))\r\n# > Prints: [{'col': 'ab'}, {'col': 'c'}, {'col': 'df'}]\r\n\r\nfiltered = ds\r\n\r\n# get all items that are starting with a character with ascii code bigger than 'a'\r\nfiltered = filtered.filter(lambda x: x['col'][0] > 'a', load_from_cache_file=False)\r\nprint(list(filtered))\r\n# > Prints: [{'col': 'c'}, {'col': 'df'}] as expected\r\n\r\n# get all items that are shorter than 2\r\nfiltered = filtered.filter(lambda x: len(x['col']) < 2, load_from_cache_file=False)\r\nprint(list(filtered))\r\n# > Prints: [{'col': 'ab'}] -> this is a leaked item from the first filter\r\n# > Should be: [{'col': 'c'}]\r\n```"
 "Thanks for reporting. I'm looking into it"
 "I just pushed a fix ! We'll do a new release soon.\r\nIn the meantime feel free to install `datasets` from source to play with it"
 "Thanks, I'm already using it from your branch!"]
## Describe the bug
As there's no support for lists within dataset fields, I convert my lists to json-string format. However, the bug described is occurring even when the data format is 'string'.
These samples show that filtering behavior diverges from what's expected when chaining filterings.
On sample 2 the second filtering leads to "leaking" of data that should've been filtered on the first filtering into the results.

## Steps to reproduce the bug
Sample 1:
```python
import datasets
import json

items = [[1, 2], [3], [4]]
jsoned_items = map(json.dumps, [[1, 2], [3], [4]])
ds = datasets.Dataset.from_dict({'a': jsoned_items})
print(list(ds))
# > Prints: [{'a': '[1, 2]'}, {'a': '[3]'}, {'a': '[4]'}] as expected

filtered = ds

# get all lists that are shorter than 2
filtered = filtered.filter(lambda x: len(json.loads(x['a'])) < 2, load_from_cache_file=False)
print(list(filtered))
# > Prints: [{'a': '[3]'}, {'a': '[4]'}] as expected

# get all lists, which have a value bigger than 3 on its zero index
filtered = filtered.filter(lambda x: json.loads(x['a'])[0] > 3, load_from_cache_file=False)
print(list(filtered))
# > Should be: [{'a': [4]}]
# > Prints: [{'a': [3]}]
```
Sample 2:
```python
import datasets
import json

items = [[1, 2], [3], [4]]
jsoned_items = map(json.dumps, [[1, 2], [3], [4]])
ds = datasets.Dataset.from_dict({'a': jsoned_items})
print(list(ds))
# > Prints: [{'a': '[1, 2]'}, {'a': '[3]'}, {'a': '[4]'}]

filtered = ds

# get all lists, which have a value bigger than 3 on its zero index
filtered = filtered.filter(lambda x: json.loads(x['a'])[0] > 3, load_from_cache_file=False)
print(list(filtered))
# > Prints: [{'a': '[4]'}] as expected

# get all lists that are shorter than 2
filtered = filtered.filter(lambda x: len(json.loads(x['a'])) < 2, load_from_cache_file=False)
print(list(filtered))
# > Prints: [{'a': '[1, 2]'}]
# > Should be: [{'a': '[4]'}] (remain intact)
```

## Expected results
Expected and actual results are attached to the code snippets.

## Actual results
Expected and actual results are attached to the code snippets.

## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 1.12.1
- Platform: Windows-10-10.0.19042-SP0
- Python version: 3.9.7
- PyArrow version: 5.0.0

{'url': 'https://api.github.com/repos/huggingface/datasets/issues/3010/reactions', 'total_count': 0, '+1': 0, '-1': 0, 'laugh': 0, 'hooray': 0, 'confused': 0, 'heart': 0, 'rocket': 0, 'eyes': 0}